Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | chip programmers | 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