2D view movement?

Blitz3D Forums/Blitz3D Beginners Area/2D view movement?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The method I mostly use is to use a cursor position for the scrolling map and one cursor position for the player.

If the player cursor moves one place then the scrolling map moves one step.

playercursorx = 20
mapcursorx = 0

The scrolling map is build from tiles (see blitzcoder) using data from an array. So if the player cursor is at 20,0 then the map cursor is at 20-5.

mapcursorx = playercursorx - 5

It can get a little complicated when using smooth scrolling and various other things.