samples/99_genre_dev_tools/tile_editor_starting_point/app/main.rb
def determineTileCords
    state.tempCounter ||= 1 # initializes tempCounter to 1
    state.tileQuantity.times do # there are 6 different kinds of tiles
      state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] # adds tile definition to collection
      state.tempX += 75 # increments tempX to put horizontal space between the patterned tiles
      state.tempCounter += 1 # increments tempCounter
      if state.tempX > 200 # if tempX exceeds 200 pixels
        state.tempX = 50 # a new row of patterned tiles begins
        state.tempY -= 75 # the new row is 75 pixels lower than the previous row
      end
    end
  end
# Determines coordinate positions of patterned tiles (on the left side of the grid)
Determines coordinate positions of patterned tiles (on the left side of the grid)
Determines coordinate positions of patterned tiles ( on the left side of the grid )
def determineTileCords
    state.tempCounter ||= 1 
    state.tileQuantity.times do 
      state.tileCords += [[state.tempX, state.tempY, state.tempCounter]] 
      state.tempX += 75 
      state.tempCounter += 1 
      if state.tempX > 200 
        state.tempX = 50 
        state.tempY -= 75 
      end
    end
  end
def determineTileCords state . tempCounter ||= 1 state . tileQuantity . times do state . tileCords += [ [ state . tempX , state . tempY , state . tempCounter ] ] state . tempX += 75 state . tempCounter += 1 if state . tempX > 200 state . tempX = 50 state . tempY -= 75 end end end
Determines coordinate positions of patterned tiles (on the left side of the grid)
Determines coordinate positions of patterned tiles ( on the left side of the grid )
# initializes tempCounter to 1 # there are 6 different kinds of tiles # adds tile definition to collection # increments tempX to put horizontal space between the patterned tiles # increments tempCounter # if tempX exceeds 200 pixels # a new row of patterned tiles begins # the new row is 75 pixels lower than the previous row