Skip to content

Instantly share code, notes, and snippets.

@snggeng
Created June 6, 2017 01:29
Show Gist options
  • Save snggeng/2e8f84dd4ed2bfe361bd9bc4b4905255 to your computer and use it in GitHub Desktop.
Save snggeng/2e8f84dd4ed2bfe361bd9bc4b4905255 to your computer and use it in GitHub Desktop.
var Player = function(settings) {
// Settings
var playerElement = null;
// Prevent player from escaping the game window
function wall() {
}
// Move the player around using arrow keys
function move(interactions){
}
// Create the object asset
function create() {
}
// Initialize all game settings
function init(){
create(); //create object
// add other functions to initialize
}
// Render function which belongs to this game object
this.render = function(interactions){
move(interactions);
}
init(); //initialize
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment