Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@videlais
Last active January 3, 2016 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/8f5c0fedbba491a8adbe to your computer and use it in GitHub Desktop.
Save videlais/8f5c0fedbba491a8adbe to your computer and use it in GitHub Desktop.
Game variables for BasicPlatformer
var map; // The tilemap
var layer; // A layer within a tileset
var player; // The player-controller sprite
var facing = "left"; // Which direction the character is facing (default is 'left')
var cursors; // A reference to the keys to use for input detection
var jumpButton; // A reference to the button used for jumping
var hozMove = 160; // The amount to move horizontally
var vertMove = -120; // The amount to move vertically (when 'jumping')
var jumpTimer = 0; // The initial value of the timer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment