vectoradd

Non-platform specific questions.

vectoradd

Postby jazz_e_bob » Sat Oct 18, 2003 9:04 am

This code:

angle = -(ship.animpos/ship.nframes)*360.0 + 90;
diretional_velocity = shot_speed;

...is in the create actor action for the shot.

It works fine when the ship is standing still.

The problem occurs when the ship travels faster. The bullets come out slower and eventually fall behind the ship.

How do I add the directional velocity of the ship to the shot?
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Sun Oct 19, 2003 12:52 am

Try this:

angle = ship.angle;
diretional_velocity = ship.diretional_velocity + shot_speed;
makslane
Site Admin
 
Posts: 3945
Joined: Sat Apr 05, 2003 6:47 pm
Score: 178 Give a positive score

Postby jazz_e_bob » Sun Oct 19, 2003 5:42 am

:oops:

All too easy. Thanks mate.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score


Return to General

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest