samples/99_genre_fighting/01_special_move_inputs/app/main.rb
def defaults args
  fiddle args

  args.state.tick_count = args.state.tick_count
  args.state.bridge_top = 128
  args.state.player.x  ||= 0                        # initializes player's properties
  args.state.player.y  ||= args.state.bridge_top
  args.state.player.w  ||= 64
  args.state.player.h  ||= 64
  args.state.player.dy ||= 0
  args.state.player.dx ||= 0
  args.state.player.r  ||= 0
  args.state.game_over_at ||= 0
  args.state.animation_time ||=0

  args.state.timeleft ||=0
  args.state.timeright ||=0
  args.state.lastpush ||=0

  args.state.inputlist ||=  ["j","k","l"]
end
# sets default values and creates empty collections
# initialization only happens in the first frame
sets default values and creates empty collections
initialization only happens in the first frame
sets default values and creates empty collections initialization only happens in the first frame
def defaults args
  fiddle args
  args.state.tick_count = args.state.tick_count
  args.state.bridge_top = 128
  args.state.player.x  ||= 0                        
  args.state.player.y  ||= args.state.bridge_top
  args.state.player.w  ||= 64
  args.state.player.h  ||= 64
  args.state.player.dy ||= 0
  args.state.player.dx ||= 0
  args.state.player.r  ||= 0
  args.state.game_over_at ||= 0
  args.state.animation_time ||=0
  args.state.timeleft ||=0
  args.state.timeright ||=0
  args.state.lastpush ||=0
  args.state.inputlist ||=  ["j","k","l"]
end
def defaults args fiddle args args . state . tick_count = args . state . tick_count args . state . bridge_top = 128 args . state . player . x ||= 0 args . state . player . y ||= args . state . bridge_top args . state . player . w ||= 64 args . state . player . h ||= 64 args . state . player . dy ||= 0 args . state . player . dx ||= 0 args . state . player . r ||= 0 args . state . game_over_at ||= 0 args . state . animation_time ||= 0 args . state . timeleft ||= 0 args . state . timeright ||= 0 args . state . lastpush ||= 0 args . state . inputlist ||= [ "j" , "k" , "l" ] end
sets default values and creates empty collections
initialization only happens in the first frame
sets default values and creates empty collections initialization only happens in the first frame
# initializes player's properties
args