Sign in to follow this  

Asteroids with Static Sprite; Center of Screen

Recommended Posts

Hey guys. I guess that this is a Noobie question, mostly. I've been toying around for a few weeks with XNA (I am a Java programmer, not really a game programmer) and I've gotten pretty capable with the C# Syntax.

My problem now is that I want to make an asteroids game where the ship stays in the middle and the objects move relative. I found this C++ example, but I couldn't discern the code well enough to understand.


Hopefully somebody here can help me out. Your help would be greatly appreciated!


P.S. More on the project at

Share this post

Link to post
Share on other sites
You have two basic options in order to solve this problem.

The recommended one is to allow the ship to move around the world freely and just keep the game focused on it (meaning keep the camera on it).
To do you this would have to be able to designate what part of the world you want to draw based on where the ship is.

The bad option is to move the entire world and keep the ship in the same spot. I would not try this because it is a bad programming practice for larger games and the camera work you would learn to use would be much more important for future games that aren't asteroids.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this