Adding the player

So we now have a working tile map, and what looks like a piece of a robotic vehicle that we can move around on the map. There are a number of issues right now, however:

  • The robot we can move around simply floats around without animation or direction.
  • Our floating sprite does not obey any kind of screen or world limitations. It will happily fly off into oblivion if you hold down the movement keys.
  • Similarly, the sprite is not blocked by wall tiles. It will float right over them.
  • Moving the sprite to the right or bottom edges of the screen doesn't scroll the camera to follow the sprite. Our camera is currently controlled by a separate set of movement keys.

In order to begin addressing these issues, we need to construct a class for the ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.