Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/20/26 18:18
Ranger by Robert Pardo - now for Zorro
by Smallz. 06/20/26 11:23
Z12 live performance
by jcl. 06/19/26 11:21
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, Grant, 1 invisible), 3,514 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
strafing 100 quants #395202
02/20/12 22:18
02/20/12 22:18
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
Can someone please tell me how can i or give me an idea of how can i make the player strafe backwards 100 quants and play the full strafe back animation by pressing only once the key?

I tryed this code below, but the player doesn't move...

Code:
if (key_space == 0 && key_space_press == 1)
{
    key_space_press = 0;
}
			
if (key_space == 1 && key_space_press == 0 && key_s)
{
    player.blendframe = unarmedB;
    key_space_press = 1;
    my.strafeForce = 250;
    my.animate2 = 0;
    my.animblend = blend;

    my.strafeForce = maxv(-30, my.strafeForce);
    my.strafeVelocity += (time_step * my.strafeForce) - (minv(time_step * 0.7, 1) * my.strafeVelocity);
    my.strafeSpeed = my.strafeVelocity * time_step;
}



Thanks

Re: strafing 100 quants [Re: Mythran] #395375
02/22/12 21:36
02/22/12 21:36
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You need a condition that applies regardless of whether any key is pressed or not. Within that conditionyou have to proove whether the strafe is fullfilled, means whether the player moved the full 100 quants, then you can switch keyspace_press back...

Re: strafing 100 quants [Re: Mythran] #396544
03/07/12 20:48
03/07/12 20:48
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
var can_press_space=1;//(global variable)yes can enter function
if(key_space==1 && can_press_space==1)
{
can_press_space=0;// disable ability to enter function over here
var distance_moved=0;
while(distance_moved<100)
{
can_press_space=0;//perhaps here
//move and increase distance_moved with the distance you move each frame
wait(1);
}
can_press_space=0;//or over here ,one of these 3 positions ?
}
if(key_space==0)can_press_space=1;//yes can enter function again..
also then use c_move or whatever method of moving


Compulsive compiler
Re: strafing 100 quants [Re: Wjbender] #396648
03/08/12 20:14
03/08/12 20:14
Joined: Sep 2006
Posts: 292
M
Mythran Offline OP
Member
Mythran  Offline OP
Member
M

Joined: Sep 2006
Posts: 292
Thank you very much! laugh


Moderated by  adoado, checkbutton, mk_1, Perro 

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