• 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!

Character_Movement

V

Violet_Lindsay

Guest
How do I make my character switch to the left sprite , or right sprite, or center sprite or down sprite when the player presses the keys and moves? This confuses me.

I got :
- obj_main_left,
-
obj_main_right,
-
obj_main_up
-
and obj_main_down

Thanks for helping me!
 
C

Cofefe

Guest
The sprite_index function may be of great use to you. ;)

EDIT
I should say, there is also the image_xscale instance variable, which you can use to flip your sprite about the vertical axis. This way you don't have to have multiple versions of the same sprite flipped.

I should also say that sprite_index also isn't a function, it is an instance variable. My bad.
 
Last edited by a moderator:
C

Cofefe

Guest
Np, and I did edit my original reply to add some more info too, plus correct my mistake in labeling a variable as a function. :D
 
Top