Game Development Reference
In-Depth Information
Figure 5-9. Constraining the spaceship at Y=25
Next, use the collision with the walls to create some boundaries for the
spaceship.
Drag and drop a Collide behavior and change the settings to Bounce when
colliding with ''actor of type''''wall'' as per Figure 5-10.
Figure 5-10 . Colliding with the wall
Group the Movement rules together to increase readability. You will use rules to
detect the accelerometer movements and make the spaceship move
accordingly.
Click Create Group and name it ''Movement.'' Click Create Rule to create a rule
inside the group. Name the rule ''Right Movement'' and configure to ''Any'' the
following conditions:
''Actor receives event''''key''''right'' keyboard is ''down''
''Attribute''''game.Accelerometer''''>''''0.2''
 
Search WWH ::




Custom Search