Ladder Animation

M

MrYolo

Guest
First off, hello everyone.So i am new to this forum and also new to the Gamemaker.I started making a game and i am testing it but there is a problem with coding.I have an animation which works with ladders but there is another animation for a power-up.When i take the power-up my character turns into a rainbow (that's what i planned).But when i start to climb it goes back to the normal animation (but it keeps the speed).Can you help me?Because i tried some other things like '' if sprite_index = spr_super {sprite_index = spr_supermerdiven} '' spr_supermerdiven is the climbing animation with power-up.Can you help me?And sorry for my bad english.
 

YoSniper

Member
It might help us help you a little more if you provided a visual aid, like what your different sprites look like.

I have a hunch that making a Finite State Machine for your sprite selection would help greatly in a situation like this. In other words, choose your sprite_index in a switch/case block.

I can help more when I have more context like visuals and code samples.
 
M

MrYolo

Guest
Okay, sorry for the late reply i don't know how to make a gif but here's the pictures. And can you explain me what's a switch/case block please ? As i said i don't know any special names.And i also have an alarm 0 in obj_1 and the code in that is ''
movespped = movespeed_normal;
jumpspeed = jumpspeed_normal;
sprite_index = spr_1;''
 

Attachments

M

MrYolo

Guest
Whatever guys, i have solved it.Thanks anyway.And if there is anyone wondering this is how i did it:
 

Attachments

Top