diff options
| author | Amir Rajan <[email protected]> | 2021-08-07 00:13:33 -0500 |
|---|---|---|
| committer | Amir Rajan <[email protected]> | 2021-08-07 00:13:33 -0500 |
| commit | a503afe87619ff82201c0a43818fa1c3f070a548 (patch) | |
| tree | 0b228a6456d17f6d0c6ea54c9ecd6a045ddbdf59 /samples/05_mouse/02_mouse_move | |
| parent | bea150381f495630f92f89d23d5f3445ec289b2d (diff) | |
| download | dragonruby-game-toolkit-contrib-a503afe87619ff82201c0a43818fa1c3f070a548.tar.gz dragonruby-game-toolkit-contrib-a503afe87619ff82201c0a43818fa1c3f070a548.zip | |
Samples folder synced.
Diffstat (limited to 'samples/05_mouse/02_mouse_move')
| -rw-r--r-- | samples/05_mouse/02_mouse_move/app/main.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/samples/05_mouse/02_mouse_move/app/main.rb b/samples/05_mouse/02_mouse_move/app/main.rb index 684928b..97edbe7 100644 --- a/samples/05_mouse/02_mouse_move/app/main.rb +++ b/samples/05_mouse/02_mouse_move/app/main.rb @@ -14,9 +14,11 @@ - args.inputs.keyboard.key_down.KEY: Determines if a key is being held or pressed. Stores the frame the "down" event occurred. + For more information about the keyboard, go to mygame/documentation/06-keyboard.md. - args.outputs.sprites: An array. The values generate a sprite. The parameters are [X, Y, WIDTH, HEIGHT, PATH, ANGLE, ALPHA, RED, GREEN, BLUE] + For more information about sprites, go to mygame/documentation/05-sprites.md. - args.state.new_entity: Used when we want to create a new object, like a sprite or button. When we want to create a new object, we can declare it as a new entity and then define @@ -198,13 +200,13 @@ class ProtectThePuppiesFromTheZombies state.zombies = state.zombies - killed_this_frame # remove newly killed zombies from zombies collection state.killed_zombies += killed_this_frame # add newly killed zombies to killed zombies - if killed_this_frame.length > 0 # if at least one zombie was killed in the frame + if killed_this_frame.length > 0 # if atleast one zombie was killed in the frame state.flash_at = state.tick_count # flash_at set to the frame when the zombie was killed # Don't forget, the rendered flash lasts for 10 frames after the zombie is killed (look at render_flash method) end # Sets the tick_count (passage of time) as the value of the death_at variable for each killed zombie. - # Death_at stores the frame where a zombie was killed. + # Death_at stores the frame a zombie was killed. killed_this_frame.each do |z| z.death_at = state.tick_count end |
