The physics of the classic game Asteroids

In summary, the speaker is a 9th grade programmer creating the game Asteroids with XNA Game Studio. They are seeking help with implementing the ship thrust and are willing to learn trigonometry before next year. They are also advised to post their question in a different forum for better responses.
  • #1
TI Wizard
1
0
I am currently in 9th grade and am a programmer, however trigonometry is next year...

You could probably consider the engine of Asteroids "basic physics", so will post it here... Sorry if this is in the wrong section.

I am creating the classic arcade game Asteroids with XNA Game Studio by Microsoft, and can't figure out how I would make the ship thrust in one direction...I assume this uses trig, but I would like to complete this game before next year :)

Any help on finding tutorials, a basic rundown on what I might need to learn (I am willing to learn some basic trig. before next year), or anything else would be greatly appreciated.

Thanks!
 
Physics news on Phys.org
  • #2
TI Wizard said:
You could probably consider the engine of Asteroids "basic physics", so will post it here... Sorry if this is in the wrong section.
Thanks!

The physics in this game is so simple, that you do not need a physicist to predict where the asteroids will go... Most physicists have not learned to program either, so a different thread would have been better, yes.

I would recommend you post this topic in a completely different forum actually. (I'm not being rude, I promise. It's just you will get much more useful replies I am guessing):redface:
 
  • #3


First of all, it's great to see that you are interested in creating a classic game like Asteroids and that you are already familiar with programming at a young age. As you mentioned, the movement of the ship in Asteroids does involve some basic physics principles and trigonometry. Let's break down the key components of the game's physics:

1) Velocity and acceleration: In Asteroids, the ship has a constant velocity and can accelerate in any direction. This means that you need to keep track of the ship's speed and direction at all times.

2) Thrust: When the player presses the thrust button, the ship should accelerate in the direction it is facing. This is where trigonometry comes into play. You need to use the ship's angle (in radians) and the ship's current speed to calculate the new velocity in the x and y directions.

3) Friction: In space, there is no air resistance, but in the game, you need to simulate it to make the ship's movement more realistic. This can be done by gradually reducing the ship's speed over time.

4) Rotation: The ship can rotate in any direction, which means you need to keep track of its angle and update it accordingly when the player presses the rotate buttons.

To learn more about these concepts, you can start by looking at tutorials on game physics and trigonometry. There are also many resources available online that can help you understand the math behind these concepts in a more visual and interactive way.

Don't worry if you don't fully understand these concepts yet, as you said, you still have time to learn them before next year. Just keep practicing and experimenting with different approaches to implement the physics in your game. Good luck!
 

1. How do the physics in Asteroids compare to real-life physics?

The physics in Asteroids are simplified and exaggerated for gameplay purposes. The game does not accurately represent the laws of gravity, momentum, and force as they would occur in real life.

2. What is the role of inertia in Asteroids?

Inertia is a key element in the gameplay of Asteroids. The player's ship and the asteroids will continue to move in the same direction and speed unless acted upon by an external force, such as thrust or collisions.

3. How do collisions work in Asteroids?

Collisions in Asteroids are based on basic physics principles. When two objects collide, their momentums are added together to determine the resulting direction and speed of each object.

4. How does the game simulate gravity in Asteroids?

The game does not have a true gravity simulation. However, the player's ship and the asteroids are affected by a "wrap-around" effect, where they will appear on the opposite side of the screen if they pass through one of the edges.

5. Are there any unrealistic aspects of the physics in Asteroids?

Aside from the simplified and exaggerated physics, there is one unrealistic aspect in the game - the player's ship can rotate and accelerate in any direction, without any force acting upon it. In reality, there would need to be an external force, such as thrusters, to change the direction and speed of an object.

Similar threads

  • Programming and Computer Science
Replies
5
Views
942
Replies
9
Views
970
Replies
2
Views
51
Replies
2
Views
1K
  • Science and Math Textbooks
Replies
9
Views
347
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
260
  • New Member Introductions
Replies
1
Views
49
Replies
15
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • STEM Academic Advising
Replies
16
Views
401
Back
Top