Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Variables you can modify
- keyLeft = vk_left; //Key to move left
- keyRight = vk_right; //Key to move right
- keyJump = vk_shift; //Key to jump
- keyRun = vk_control; //Key to run
- if (keyboard_check(keyRight))
- {
- sprite_index = sprPlayerRun;
- image_xscale = 1;
- }
- if (keyboard_check(keyLeft))
- {
- sprite_index = sprPlayerRun;
- image_xscale = -1;
- }
- fric = 0.1; //Friction: the acceleration of the player
- slow = 0.1; //The deacceleration of the player
- maxSpeed = 2; //Maximum speed while not running
- maxSpeedRunning = 4; //Maximum speed while running
- jumpHeight = 7; //How high the player can jump
- _gravity = 0.25; //The gravity the player has
- //Variables you don't want to mess around with
- view_object = id; //Makes sure the view is following the player
- ground = true; //We are on the ground on default
- global.vel = 0; //Our starting horizontal speed is 0
- vspeed = 0; //Our starting vertical speed is 0
- slowSlope = false; //We are not going slow up a slope
- fastSlope = false; //We are not going fast down a slope
- slopeAmount = 0; //We are not on a slope yet, so the slowness/speed factor of a slope is 0
- canhit = true; //We can get hit
Advertisement
Add Comment
Please, Sign In to add comment