Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / exponential curve on a sprite

Author
Message
alanuk
22
Years of Service
User Offline
Joined: 25th Mar 2003
Location: United Kingdom
Posted: 23rd May 2003 22:05
I am trying to get an effect like a bulet coming out of a gun and falling to the ground.

The sprite is moving across the screen and I want it to fall to the bottom in a curve something like an exponential effect, but any curve will do.

I am stuck with this one all afternoon.

Any ideas please?

regards Alan
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 23rd May 2003 22:54
I'd think you'd want something more parabolic to simulate gravity.

Easiest way (you can fudge with values later) is the following:
When you shoot the gun, set yvelocity# to 0 for the bullet.
Every itteration, subtract 1 from yvelocity#.
Additionally, every itteration, set the bullet ypos# to ypos#+yvelocity#.

Login to post a reply

Server time is: 2025-05-18 22:09:35
Your offset time is: 2025-05-18 22:09:35