Archived

This topic is now archived and is closed to further replies.

llamaboy

pixel by pixel vs pixel by tile scrolling?

Recommended Posts

i''m doing a little super mario bros clone right now and i''m guessing it uses pixel by pixel scrolling instead of pixel by tile. does anyone know for sure? is it just a tile-engine with pixel by pixel scrolling? my engine is a tile-based engine... what would be the best way to include pixel-by-pixel scrolling in a tile-based engine? thanks for any help, gary

Share this post


Link to post
Share on other sites
quote:
Original post by llamaboy
what would be the best way to include pixel-by-pixel scrolling in a tile-based engine?


Read the generic article here and the DirectX article here to get an idea on how to do pixel-by-pixel scrolling with tiles.

Share this post


Link to post
Share on other sites
No, it''s easy enough.

In tile-by-tile, you''d just check the map array to see if there''s a wall to, for example, the left of the player:

is_wall = map[player_x - 1][player_y]

In pixel-by-pixel, you do the same thing, only you test whenever the player is at the exact tile-position, by using modulo


if ((player_x % tile_width) == 0)
is_wall = map[(player_x / tile_width) - 1)][player_y]


This should work.

A 2D Developer''s Board

Share this post


Link to post
Share on other sites