Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,246 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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