Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Map < Base
- def start
- create_ground
- end
- def create_ground
- @ground = Sprite.new(nil)
- @ground.z = 0
- @ground.bitmap = Bitmap.new(Graphics.width, Graphics.height)
- @tileset = Bitmap.new('Graphics/Tilesets/0.png')
- draw_ground
- end
- def draw_ground
- src_bitmap = @tileset
- src_rect = Rect.new(16 * 7, 16, 16, 16)
- max_x = Graphics.width / 16
- max_y = Graphics.height / 16
- @ground.bitmap.clear
- for x in 0...max_x
- for y in 0...max_y
- dest_rect = Rect.new(x * 16, y * 16, 16, 16)
- @ground.bitmap.stretch_blt(dest_rect, src_bitmap, src_rect)
- end
- end
- end
- def terminate
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement