GameMaker Sprite Change

I

iTypewriter

Guest
So, I'm making a simple brawler, similar to the original Street Fighter, but with a spin based on the show Hunter x Hunter. i have a character that uses a defense-up, and I'm trying to make the right mouse button activate the defense-up, with a 10 second cool-down. At the moment, the main sprite is spr_gon. The def-up is spr_gon_ten. I can't seem to make it work. Accepting either DnD or GML. Feel free to explain it like I'm 5.


Thanks,
iTypewriter
 
K

Kamon145

Guest
in gml the code would be something like
Code:
if mouse_check_button_pressed(mb_left) //checks if button has just been pressed
{
      sprite_index = spr_gon_ten
}
if you want him to only be able to do it when he is in the first sprite you could add if mouse_check_button_pressed(mb_left) and sprite_index == spring_gon
This would check if the button is pressed and if he is currently using the first sprite
 
I

iTypewriter

Guest
in gml the code would be something like
Code:
if mouse_check_button_pressed(mb_left) //checks if button has just been pressed
{
      sprite_index = spr_gon_ten
}
if you want him to only be able to do it when he is in the first sprite you could add if mouse_check_button_pressed(mb_left) and sprite_index == spring_gon
This would check if the button is pressed and if he is currently using the first sprite
Awesome! This works beautifully, and its working well. Thank you!
 
Top