AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Flap flap flap (https://forums.alliedmods.net/showthread.php?t=274331)

Chihuahuax 11-06-2015 01:46

[Help] Flap flap flap
 
Is there an efficient way to code flapping motion (up-down-up-down~, like flappy bird's flying motion)?
https://tctechcrunch2011.files.wordp...appy.gif?w=738

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

zmd94 11-06-2015 02:17

Re: [Help] Flap flap flap
 
Bounce code?

Chihuahuax 11-06-2015 02:19

Re: [Help] Flap flap flap
 
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

zmd94 11-06-2015 02:41

Re: [Help] Flap flap flap
 
Alright. Will wait for the answer.

Kowalsky 11-08-2015 10:11

Re: [Help] Flap flap flap
 
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 }


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

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