'Curtain Shooter' Math

  • Thread starter Bucky
  • Start date
  • #1
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 isnt 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 im 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:

Answers and Replies

  • #2
daniel_i_l
Gold Member
867
0
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
82
0
Thats exactly what i needed. Thanks a lot for your help! :)
 

Related Threads on 'Curtain Shooter' Math

  • Last Post
Replies
4
Views
7K
  • Last Post
Replies
6
Views
2K
Replies
1
Views
1K
  • Last Post
Replies
10
Views
1K
Replies
4
Views
1K
Replies
10
Views
3K
  • Last Post
2
Replies
26
Views
3K
  • Last Post
Replies
1
Views
2K
Top