samples/05_mouse/02_mouse_move/app/main.rb
# Sets default values for the zombies and for the player.
# Initialization happens only in the first frame.
Sets default values for the zombies and for the player.
Initialization happens only in the first frame.
Sets default values for the zombies and for the player . Initialization happens only in the first frame .
def defaults
    state.flash_at               ||= 0
    state.zombie_min_spawn_rate  ||= 60
    state.zombie_spawn_countdown ||= random_spawn_countdown state.zombie_min_spawn_rate
    state.zombies                ||= []
    state.killed_zombies         ||= []
    state.player ||= state.new_entity(:player, { x: 640,
                                               y: 360,
                                               attack_angle: 0,
                                               dx: 0,
                                               dy: 0 })
  end
def defaults state . flash_at ||= 0 state . zombie_min_spawn_rate ||= 60 state . zombie_spawn_countdown ||= random_spawn_countdown state . zombie_min_spawn_rate state . zombies ||= [ ] state . killed_zombies ||= [ ] state . player ||= state . new_entity ( :player , { x : 640 , y : 360 , attack_angle : 0 , dx : 0 , dy : 0 } ) end
Sets default values for the zombies and for the player.
Sets default values for the zombies and for the player .
# Declares player as a new entity and sets its properties. # The player begins the game in the center of the screen, not moving in any direction.