Raised This Month: $ Target: $400
 0% 

[Help] Flap flap flap


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-06-2015 , 01:46   [Help] Flap flap flap
Reply With Quote #1

Is there an efficient way to code flapping motion (up-down-up-down~, like flappy bird's flying motion)?


the only idea i've got is to execute an upward force every second, not sure if there is better way(s) to do it

Last edited by Chihuahuax; 11-06-2015 at 01:56.
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-06-2015 , 02:17   Re: [Help] Flap flap flap
Reply With Quote #2

Bounce code?
zmd94 is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-06-2015 , 02:19   Re: [Help] Flap flap flap
Reply With Quote #3

Yeah something like that, but it doesnt use codes like EntityContact, FindEntityInSphere etc.

Currently im making a flying creature plugin and i want it to look more realistic when it is in hover mode

Last edited by Chihuahuax; 11-06-2015 at 02:34.
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-06-2015 , 02:41   Re: [Help] Flap flap flap
Reply With Quote #4

Alright. Will wait for the answer.
zmd94 is offline
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 11-08-2015 , 10:11   Re: [Help] Flap flap flap
Reply With Quote #5

The way I was doing it :

Add some int variable to the entity, e.g. EV_INT_iuser1.
Then in Entity Think add something like this

Code:
if( this_int ) { // get velocity of the entity // add +30 (or whatever number you want) to the velocity[2] ( Z axis ) if this_int == 1 and - 30 if this_int == 0. // every time you have to change this_int 1/0 }
Kowalsky is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode