S
SonicTheHedgehog+123
Guest
Hello everyone
I want my player to duck if the button "D" is presse. It should use the sprite duck and if the player is in the duck
state he cant go left or right or jump. Also when the player is in the air and ducks he falls down.
My problem is that when the player goes from the duck to the normal sprite he cant switch to other sprites unless the duck button is pressed this is bad because I have items in my game and the player should switch to other sprites if he collides with the Item .This function doesnt work anymore because the player will take always the 1. sprite if the player is not ducking. Is there a possibility to solve this problem with variables or is there a better way. However this is a complicated task I would be very happy I get help
Step Event:
if keyboard_check(ord("S"))
{
sprite_index = Ducken
}
else
{
sprite_index = Fledermaus_Bild
}
if sprite_index = Ducken
{
hspeed = 0;
vspeed = 0;
}
I want my player to duck if the button "D" is presse. It should use the sprite duck and if the player is in the duck
state he cant go left or right or jump. Also when the player is in the air and ducks he falls down.
My problem is that when the player goes from the duck to the normal sprite he cant switch to other sprites unless the duck button is pressed this is bad because I have items in my game and the player should switch to other sprites if he collides with the Item .This function doesnt work anymore because the player will take always the 1. sprite if the player is not ducking. Is there a possibility to solve this problem with variables or is there a better way. However this is a complicated task I would be very happy I get help
Step Event:
if keyboard_check(ord("S"))
{
sprite_index = Ducken
}
else
{
sprite_index = Fledermaus_Bild
}
if sprite_index = Ducken
{
hspeed = 0;
vspeed = 0;
}
Last edited by a moderator: