Drawing objects wider than 1 tile
Hi
How to draw object''s wider than 1 tile? That about colision detection? Do I have to cut the image into tiles?
KriS
Depends on how you define a tile to be passable or not. If that information is in the map you don''t need to cut the image up. If it''s in a seperate tile struct, you''d probably be better off cutting it into tiles.
Ben
Ben
If i use TANSTAAFL render method...to bltfast object (for example ''House'' )on tiles, It cannot display object when scroll.
Layer 1:
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 is grass tile on layer1, 1 is house tile on layer1
(If the (4,4) flag is not visible on screen, then the house disappear.)
Did need break the house tile(320x320) to small pieces(64x32) ?
Cutting it up would be the choice i would take ! How i solved a similar problem, is that i made 2 layers: Terrain and Objects ! They both used the same tileheight and tilewidth, and when i scrolled, i scrolled both layers with the same speed. It''s kind''a slow, but it''s lot easyer to code ! If the object was smaller then the terrain tile size, then i just blitted it, creating a new array of "object tiles" !
"Find the path, follow the Master... Follow the master, understand the master... Be the master !
"Find the path, follow the Master... Follow the master, understand the master... Be the master !
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement