Search the Community
Showing results for tags 'var'.
-
the only change made is the label name? var ledge = HORIZ_.create(50, 50, 'VERT_400'); ledge.body.immovable = true; // LEFT MOST VERTICAL var ledge = VERT_.create(50, 50, 'VERT_400'); ledge.body.immovable = true; // LEFT MOST VERTICAL var newname = HORIZ_.create(50, 50, 'VERT_400'); ledge.body.immovable = true; // LEFT MOST VERTICAL https://youtu.be/hdvo3_j8hMU myPit.html
-
hi, i'm beginnin with js and phaser and I have some questions related to this snippet "the game.js" ( it's based on a tutorial from Emmanuel Ferrato). var theGame = function(game){ spriteNumber = null; number = 0; workingButtons = true; higher = true; } theGame.prototype = { create: function(){ number = Math.floor(Math.random()*10); spriteNumber = this.game.add.sprite(160,240,"numbers"); var higherButton = this.game.add.button(160,100,"higher",this.clickedHigher,this); higherButton.anchor.setTo(0.5,0.5); clickedHigher: function(){ higher=true; this.tweenNumber(true); }, tweenNumber: function(higher){ } }, } normally when we declare a variable we write : var myVariable = somestuff here,it's write spriteNumber = null; without var and with = null > why ? for wich reason ? next the clickedHigher : function() wath is the signification of this ? what does it refer ? thanks for your lights