• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [solved]Switch image_index 0 and 1 and ignore image_index 2

S

SonicTheHedgehog+123

Guest
I am making a platformer and I want my player to duck. I have two possibilities.
1. Make the player switch between sprite_index(doesnt work because I also must switch to my power up sprites)
2.Make the player switch between the image_index

I think its more practical to do it with the second option after trying so long with the first.
The problem(here it comes) is that i want the player to start with the image_index 0 continue with the image_index 1
and ignore the image index 2

So image_index 0 and 1 give me the animation and 2 gets only activated when i press the "S" button.
Is this possible to execute with gm?
Open for any help:D
Code:
//This is the code with the sprite_index
if keyboard_check(ord("S"))
{
sprite_index = Ducken
move = 8
alarm[1] = 360
}
else
{
sprite_index = Fledermaus_Bild
}
if sprite_index = Ducken 
{
hspeed = 0
}
 
Top