Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/26/26 21:35
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, Grant, Martin_HH), 5,405 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
floating problem #99998
11/26/06 12:53
11/26/06 12:53
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
-------------------------------------------------------------------------------
Action player1_action
{
while (1){
.........
if(key_f==1)
{
if(floatstate==0)
{
my.z=50;
my.blendframe = float;
my.animate2 = 0;
my.animblend = blend;
handle_char4_movement();
handle_camera();
handle_char4_animation(1);
floatstate=1;
}
else
{
if(floatstate==1)
{
my.z=-3;
my.blendframe = stand;
my.animate2 = 0;
my.animblend = blend;
handle_char4_gravity();
handle_char4_movement();
handle_camera();
handle_char4_animation(1);
floatstate=0;
}
}
}
else{
if(key_f==0){
floatstate=0;
handle_char4_gravity();
handle_char4_movement();
handle_camera();
handle_char4_animation(1);
}
}
}
}


--------------------------------------------------------------------------------


This code is to make the charater float when f is press.
but how come when i release F in come down again.
how to make it permenant float and the second time i press it come back down?
i got float state value to let the animation function to determine when to fly and when to walk.

Last edited by alex5801; 11/26/06 12:54.
Re: floating problem [Re: alex5801] #99999
11/27/06 22:55
11/27/06 22:55
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
logical error, rearrange your code.
your code:
while(...){
if (key...){
if (state...){
...
}}}
should be:
while(...){
if (key...){
//change state skill
}
...
if (state...){
//make your animations, etc
}}


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1