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 - .center_x y = world_y - .center_y .width.times do |xi| .height.times do |yi| tx, ty = x+xi, y+yi tile = fetch tx, ty .put_tile xi, yi, tile end end end |