Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Sprite animation
- //Facing directions
- if keyR
- image_xscale = 1;
- else if keyL
- image_xscale = -1;
- //Facing up and down
- if keyU
- sprite_index = sprQuoteUp;
- else if (keyD && (!keyL and !keyR)) or (!vGround and keyD)
- sprite_index = sprQuoteDown;
- else
- sprite_index = sprQuote;
- //Collision animation
- if vGround
- {
- if vHspeed = 0
- {
- image_index = 0;
- frameTimer = 0;
- }
- else
- {
- frameTimer++;
- if (frameTimer >= updateTime)
- {
- image_index += 1;
- if ((keyL || keyR) && (image_index == 4) || (image_index == 2))
- play_sfx(sfxQuoteWalk);
- if (image_index > 3)
- image_index = 0;
- frameTimer = 0;
- }
- else if keyD && (!keyL and !keyR)
- {
- image_index = 0;
- }
- }
- }
- else
- {
- //Checks if jumping or falling
- if vVspeed < 0
- {
- image_index = 1;
- }
- else
- {
- image_index = 3;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement