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.

Newcomers DBPro Corner / Sprite on sinus curve

Author
Message
Monzi
20
Years of Service
User Offline
Joined: 10th May 2004
Location: Denmark
Posted: 5th Jun 2004 12:03
How do i make my Sprite move in a sinus-wave movement?
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 5th Jun 2004 18:07
static (both examples assume you have a sprite 1 made with image 1)

constant=50
for i=1 to 360 step 5
height=constant*sin(i)
sprite 1,height,y_position,1
next i

moving

y_speed=2
y_position=0
constant=50
for i=1 to 360 step 5
height=constant*sin(i)
y_position=y_position+y_speed
sprite 1,height,y_position,1
next i

should work fine, cheers.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
Monzi
20
Years of Service
User Offline
Joined: 10th May 2004
Location: Denmark
Posted: 5th Jun 2004 22:19
Thanks alot Mentor

I'll try it out a little later
UberTuba
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 6th Jun 2004 03:03
how to make a sinus wave movement:
sneeze

I'm Right and Reality is lying
Monzi
20
Years of Service
User Offline
Joined: 10th May 2004
Location: Denmark
Posted: 6th Jun 2004 12:01 Edited at: 6th Jun 2004 12:01
God bless You

Login to post a reply

Server time is: 2024-09-22 12:34:27
Your offset time is: 2024-09-22 12:34:27