|
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Author |
Message |
Cooljoesmith
Joined: Sat Jan 31, 2009 11:34 pm Posts: 88 Location: The U S of A's
|
Help with sine waves
I want to make a projectile move along a path using sine. But to tell the truth, I am really not sure how to do this. I would imagine using the velocity with the sine function and all that.
Essentially i want to have a projectile move along a wavy path(sine). It has to work regardless what angle the projectile is fired.(fancy looking projectile yay)
any help will be wonderful. thank you.
|
Sun Oct 25, 2009 6:08 am |
|
|
findude
Joined: Tue Dec 12, 2006 3:10 pm Posts: 495 Location: Uncertain quantum state
|
Re: Help with sine waves
Unfortunately I can't give you the complex 50 line math blah, but I can suggest using a timer, sine function on it, and self.Vel.Perpendicular.
|
Sun Oct 25, 2009 11:07 am |
|
|
Barnox
Joined: Mon Jun 22, 2009 3:57 pm Posts: 1020
|
Re: Help with sine waves
Shook's Pack O' Mods has a Sine wave gun. But it only shoots horizontally. Aiming higher/lower changes the speed. You could try looking at the code for that, and cannibalising it?
I'd upload the .lua file, but I'm not sure what the rules are on posting other people's code.
|
Sun Oct 25, 2009 11:40 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Help with sine waves
To make a true sine wave in all directions, you'd have to have the projectile figure out what direction it was aimed at and instead of linking the X or Y coordinate to the sine function, link the sine function to some scalar perpendicular to the particle's motion vector. I'm not that great with math, but it should be doable if you have a good knowledge of trig and coordinate math...
|
Sun Oct 25, 2009 1:23 pm |
|
|
Cooljoesmith
Joined: Sat Jan 31, 2009 11:34 pm Posts: 88 Location: The U S of A's
|
Re: Help with sine waves
ok, i'll look as the pack'o mods and see if i can use the sine gun to my needs.
|
Sun Oct 25, 2009 3:41 pm |
|
|
Abdul Alhazred
DRL Developer
Joined: Tue Aug 11, 2009 5:09 am Posts: 395
|
Re: Help with sine waves
Free to use for anyone.
Edit: The code I wrote is complicated in a stupid way so I have attached a better version that also fire two bullets in a mirrored pattern.
|
Sun Oct 25, 2009 6:27 pm |
|
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users |
|
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
|
|