ThinkingParticlesとXPressoを使って、ブロックくずしを作った。このシーンには11個のXPressoが含まれていて、それぞれ次のような働きをしている。
racket:
_ ラケットの移動範囲を制限する
blocks_D:
_ D列のブロックとパーティクルとの衝突判定を行い、衝突したブロックをカメラの背後に移動させる
counter_D:
_ D列のブロックの位置を監視し、ブロックの移動に応じてカウンタを回転させる
_ A、B、C列のXPressoも同様に働く...
particle_controller:
_ パーティクルを生成させる。
_ パーティクルと壁、ラケットとの衝突判定を行う。
_ パーティクルにボールを乗せる。
_ パーティクルをZY平面内に拘束する。
_ B、C、D列のカウンタの角度を監視し、パーティクルの速度を変更する。
indicator:
_ 時間が350フレームを越えたり、パーティクルが-250より下に移動した場合、「GAME OVER」という文字を表示し、同時にパーティクルを消滅させる。
_ A、B、C、D列のカウンタの角度を監視し、パーティクルが全てのブロックに衝突したら「YOU WIN」という文字を表示し、同時にパーティクルを消滅させる。
_ フレーム数をスコアに変換し、パーティクルが全てのブロックに衝突したらその値を表示し、同時に値をロックする。
*
I have made Block Buster game with the ThinkingParticles and XPresso. This scene includes 11 XPresso nodes and each node works as below.
racket:
_ Limit racket motion in specified area.
blocks_D:
_ Detect collision between each block in D row and particle, then move the block to backside of the camera.
counter_D:
_ Get position of blocks in D row, then rotate counter along with it.
The XPresso nodes for A, B, C row work same.
particle_controller:
_ Generate particle.
_ Detect collision between walls or racket and particle.
_ Attach ball to the particle.
_ Limit particle position in YZ plane.
_ Get angle of counters of B, C, D row, then change the particle speed.
indicator:
_ If the time exceed 350 frames, or the particle goes under -250, show "GAME OVER" text, and also delete the particle.
_ Get angle of counters of A, B, C, D row, if the particle collides all blocks, then show "YOU WIN" text, and also delete the particle.
_ Convert the frame value to game score, and if the particle collides all blocks, then show it, and also lock the score.
|