Method: UT::Engine#update

Defined in:
lib/ut/engine.rb

#update(world_x, world_y) ⇒ Object

Updates the Engine. world_x and world_y represents the center of the world that should be rendered in _tile coordinates_.



107
108
109
110
111
112
113
114
115
116
117
# File 'lib/ut/engine.rb', line 107

def update world_x, world_y
  x = world_x - @viewport.center_x
  y = world_y - @viewport.center_y
  @viewport.width.times do |xi|
    @viewport.height.times do |yi|
      tx, ty = x+xi, y+yi
      tile = fetch tx, ty
      @viewport.put_tile xi, yi, tile
    end
  end
end