Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Los recursos de Script han cambiado para la v2.3.0 Consulta
- // https://help.yoyogames.com/hc/en-us/articles/360005277377 para más información
- function scrMovement(){
- #region Walk/Run
- XSpeed = 0;
- if input_check("left"){
- XSpeed = -1*Speed;
- state = "Walk"
- image_xscale = -1
- }else if input_check("right"){
- XSpeed = Speed;
- state = "Walk"
- image_xscale = 1
- }
- if input_check_double("left"){
- XSpeed = -1*RunSpeed;
- state = "Run"
- image_xscale = -1
- }else if input_check_double("right"){
- XSpeed = RunSpeed;
- state = "Run"
- image_xscale = 1
- }
- YSpeed = 0;
- if input_check("up"){
- YSpeed = -1*Speed;
- state = "Walk"
- }else if input_check("down"){
- YSpeed = Speed;
- state = "Walk"
- }
- if input_check_double("up"){
- YSpeed = -1*RunSpeed;
- state = "Run"
- }else if input_check_double("down"){
- YSpeed = RunSpeed;
- state = "Run"
- }
- x += XSpeed;
- y += YSpeed;
- #endregion
- //Sets the Players' depth based on their GroundY. We're using GroundY instead of y so that even when they're in the air, they will display in fornt of and behind the right objects.
- depth = -1*GroundY;
- if (XSpeed = 0 and YSpeed = 0){
- state = "Idle"
- };
- CheckGridPosition(y, startingY, finishingY)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement