samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb
def defaults
    state.tileCords      ||= []
    state.tileQuantity   ||= 6
    state.tileSize       ||= 50
    state.tileSelected   ||= 1
    state.tempX          ||= 50
    state.tempY          ||= 500
    state.speed          ||= 4
    state.centerX        ||= 4000
    state.centerY        ||= 4000
    state.originalCenter ||= [state.centerX, state.centerY]
    state.gridSize       ||= 1600
    state.lineQuantity   ||= 50
    state.increment      ||= state.gridSize / state.lineQuantity
    state.gridX          ||= []
    state.gridY          ||= []
    state.filled_squares ||= []
    state.grid_border    ||= [390, 140, 500, 500]

    get_grid unless state.tempX == 0 # calls get_grid in the first frame only
    determineTileCords unless state.tempX == 0 # calls determineTileCords in first frame
    state.tempX = 0 # sets tempX to 0; the two methods aren't called again
  end
# Sets default values
# Initialization only happens in the first frame
# NOTE: The values of some of these variables may seem confusingly large at first.
# The gridSize is 1600 but it seems a lot smaller on the screen, for example.
# But keep in mind that by using the "W", "A", "S", and "D" keys, you can
# move the grid's view in all four directions for more grid spaces.
Sets default values
Initialization only happens in the first frame
NOTE: The values of some of these variables may seem confusingly large at first.
The gridSize is 1600 but it seems a lot smaller on the screen, for example.
Sets default values Initialization only happens in the first frame NOTE : The values of some of these variables may seem confusingly large at first . The gridSize is 1600 but it seems a lot smaller on the screen for example .
def defaults
    state.tileCords      ||= []
    state.tileQuantity   ||= 6
    state.tileSize       ||= 50
    state.tileSelected   ||= 1
    state.tempX          ||= 50
    state.tempY          ||= 500
    state.speed          ||= 4
    state.centerX        ||= 4000
    state.centerY        ||= 4000
    state.originalCenter ||= [state.centerX, state.centerY]
    state.gridSize       ||= 1600
    state.lineQuantity   ||= 50
    state.increment      ||= state.gridSize / state.lineQuantity
    state.gridX          ||= []
    state.gridY          ||= []
    state.filled_squares ||= []
    state.grid_border    ||= [390, 140, 500, 500]
    get_grid unless state.tempX == 0 
    determineTileCords unless state.tempX == 0 
    state.tempX = 0 
  end
def defaults state . tileCords ||= [ ] state . tileQuantity ||= 6 state . tileSize ||= 50 state . tileSelected ||= 1 state . tempX ||= 50 state . tempY ||= 500 state . speed ||= 4 state . centerX ||= 4000 state . centerY ||= 4000 state . originalCenter ||= [ state . centerX , state . centerY ] state . gridSize ||= 1600 state . lineQuantity ||= 50 state . increment ||= state . gridSize / state . lineQuantity state . gridX ||= [ ] state . gridY ||= [ ] state . filled_squares ||= [ ] state . grid_border ||= [ 390 , 140 , 500 , 500 ] get_grid unless state . tempX == 0 determineTileCords unless state . tempX == 0 state . tempX = 0 end
Sets default values
Initialization only happens in the first frame
NOTE: The values of some of these variables may seem confusingly large at first.
Sets default values Initialization only happens in the first frame NOTE : The values of some of these variables may seem confusingly large at first .
# calls get_grid in the first frame only # calls determineTileCords in first frame # sets tempX to 0; the two methods aren't called again