Math for 'Curtain Shooter' Games

  • Context: Undergrad 
  • Thread starter Thread starter Bucky
  • Start date Start date
Click For Summary
SUMMARY

This discussion focuses on the mathematical principles necessary for creating a 'curtain shooter' game, specifically in a 2D environment. Key tasks include creating a circle, plotting points at regular intervals around the circle, and dynamically increasing the circle's radius each frame. The use of sine and cosine functions is essential for calculating the (x, y) positions of bullets based on their angle and distance from the center. The discussion confirms that the calculations are straightforward, particularly in C/C++, where trigonometric functions require radians as input.

PREREQUISITES
  • Understanding of 2D geometry and trigonometry
  • Familiarity with C/C++ programming language
  • Knowledge of frame-based game development concepts
  • Ability to manipulate mathematical functions for game mechanics
NEXT STEPS
  • Research "Circle Drawing Algorithms in Game Development"
  • Learn about "Dynamic Radius Adjustment in Game Loops"
  • Study "Trigonometric Functions in C/C++ for Game Physics"
  • Explore "Bullet Pattern Design in 2D Shooter Games"
USEFUL FOR

Game developers, particularly those focused on 2D shooter mechanics, programmers looking to implement dynamic bullet patterns, and anyone interested in applying mathematical concepts to game design.

Bucky
Messages
79
Reaction score
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
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.
 
Thats exactly what i needed. Thanks a lot for your help! :)
 

Similar threads

  • · Replies 39 ·
2
Replies
39
Views
5K
  • · Replies 25 ·
Replies
25
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 50 ·
2
Replies
50
Views
7K
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • Sticky
  • · Replies 48 ·
2
Replies
48
Views
70K