Thanks Ashley, great article. Not sure it applies here.
the student is using a small number of sprites with movement managed with behaviours only.
The ball is rotated 180 degrees when spawned if the player is facing left, then managed by the behaviour.
Objects are:
name |
type |
behaviours |
instance vars |
player |
sprite |
platform, scrollto |
health |
ball |
sprite |
bullet (with bounce) |
|
platform |
sprite |
solid |
|
lava |
sprite |
|
|
thealth |
text |
|
|
bg |
sprite |
|
|
keyboard |
|
|
|
most sprites are 16x16 pixel colour filled squares.
ball is 8x8 pixels, still with square collision box.
bg has a large 1920x1200 image and in a background layer with 50% parallax.
Text copy of the event sheet is as follows:
[System Rules]
----+ System: Every tick
-----> tHealth: Set text to "Health: " & player.health
[Player Rules]
----+ player: Is overlapping lava
--------+ System: Every 1.0 seconds
---------> player: Subtract 1 from health
----+ player: health ≤ 0
-----> System: Restart layout
----+ Keyboard: On ← pressed
-----> player: Set Mirrored
----+ Keyboard: On → pressed
-----> player: Set Not mirrored
[Ball Rules]
----+ ball: On collision with player
-----> ball: Destroy
----+ Keyboard: On Space pressed
--------+ System: ball.Count=0
---------> player: Spawn ball on layer "main" (image point 0) (create hierarchy: False)
------------+ player: Is mirrored
-------------> ball: Set Bullet angle of motion to -180 degrees