It is currently Sun Oct 22, 2017 8:53 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Feb 15, 2005 9:21 pm 
Hi all,

How could I program the movement of bullets with
arbitrary pattern?

say, they move straight with different angles and velocities

possible for them to move in curves?

what's the easiest to handle them? as i have to monitor their
movements and collisions with other objects...

Blanc


Top
  
 
 Post subject:
PostPosted: Wed Feb 16, 2005 12:35 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Doing something like x=-y^2 would be fine.
You can do a code to calculate something like this if you want to change angles and velocities. Looking at the Solar War's source would be a good starting point.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 16, 2005 9:54 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
The easiest and most realistic way to move bullets in curves is to keep fixed-point velocity and displacement vectors for each bullet. Then each frame perform Euler integration: add accelerations due to force (gravity, wind, etc) to velocity, add velocity to displacement, and take the integer portion of displacement and put it on screen.

Go look up analytic geometry and Newtonian kinematics on Wikipedia if you want some background.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group