Math for 'Curtain Shooter' Games

  • Thread starter Bucky
  • Start date
In summary, the conversation is about creating a 'curtain shooter' game, which is a side scrolling shooter with a large number of bullets. The problem lies in plotting points around a circle and growing the circle and the space between intervals each frame. The solution suggested is to use sine and cosine waves to determine the position of each bullet, with the distance from the center represented by r and the angle between each bullet being 360/n. Increasing the value of r each frame will allow the circle to grow. The person seeking help expresses gratitude for the solution given.
  • #1
Bucky
82
0
Hi, I'm trying to create a 'curtain shooter' game. Essentially this is a side scrolling shooter (think Gradius, R-Type etc) but the enemies throw out a rediculous number of bullets. Here is an example:

http://www.sss-mag.com/images/strayfire2.jpg

could anyone advise me as to how I could do the mathmatical side of this? I've looked at what I am trying to do and have summarised that I need to:

i) Create a circle (n.b - this isn't a problem)
ii) Plot points at regular points around the circle (this is where the problem lies)
iii) The circle will also have to grow by a set amount each frame, and the space between the intervals will have to grow also.

I was also hoping to do something with sine and cosine waves.

However I am not sure how to approach this (I get the feeling its a lot easier than I think it is...its 2d geometary). Is there a specific topic i should look up? Can anyone recommend specific reading?
 
Last edited:
Physics news on Phys.org
  • #2
Give each bullet a certain angle if there are n bullets then the angle between each one startion from 0 would be 360/0. To get the bullets (x,y) position were the distance of each bullet from the center is r,
x = rcos(angle), y = rsin(angle) - (don't forget to change to radians first. I'm not sure about other languages but in C/C++ the sin and cos functions take radians as input)
Now you simply have to increase the r every frame.
 
  • #3
Thats exactly what i needed. Thanks a lot for your help! :)
 

FAQ: Math for 'Curtain Shooter' Games

What is the importance of math in "Curtain Shooter" games?

Math is essential in "Curtain Shooter" games as it is the foundation for all the game mechanics. It helps in determining the trajectory of bullets and objects, calculating scores, and creating challenging levels.

How does geometry play a role in "Curtain Shooter" games?

Geometry is crucial in "Curtain Shooter" games as it helps in calculating angles, distances, and shapes of objects. This is important for players to accurately aim and shoot at targets.

What are some common mathematical concepts used in "Curtain Shooter" games?

Some common mathematical concepts used in "Curtain Shooter" games include trigonometry, algebra, and calculus. These concepts are used to calculate trajectories, velocities, and other variables for game elements.

How do game developers use math in creating "Curtain Shooter" games?

Game developers use math to create the physics and mechanics of the game. They use mathematical equations and algorithms to determine the movement and behavior of objects, as well as to create challenging levels for players.

Can playing "Curtain Shooter" games improve math skills?

Yes, playing "Curtain Shooter" games can improve math skills. As players aim and shoot at targets, they are subconsciously using math concepts such as angles, trajectories, and velocity. This can help improve their proficiency and understanding of these concepts in a fun and engaging way.

Similar threads

Replies
25
Views
3K
Replies
3
Views
408
Replies
2
Views
3K
Replies
2
Views
3K
Replies
48
Views
63K
Replies
4
Views
3K
Replies
5
Views
3K
Replies
4
Views
3K
Back
Top