Draxy Posted June 28, 2017 Share Posted June 28, 2017 Noob here, I'm trying to get an update function to call inside a separate JS file. I have a basic phaser structure in load.js: var myGame = {}; myGame.load = function (game) { }; myGame.load.prototype = { preload: function() { //.. }, create: function(){ //... } }; myGame.update = function(game) { }; myGame.load.prototype = { update: update }; And the update function I'm trying to add and call in update.js update = function() { game.physics.arcade.collide(blue_player, platforms); console.log("update is working"); }; load.js is loaded before update.js in my HTML Thanks a lot for reading Link to comment Share on other sites More sharing options...
Recommended Posts