Jump to content

Search the Community

Showing results for tags 'keyword'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi all. I am wondering why there is such extensive usage of the "this" keyword in the "Full Screen Mobile" project template (included with Phaser, I am using v2.4.4). Code sample from 'Full Screen Mobile' project template: BasicGame.Boot.prototype = { init: function () { this.input.maxPointers = 1; this.stage.disableVisibilityChange = true; this.stage.backgroundColor = '#000000'; if (this.game.device.desktop) { this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.setMinMax(160, 240, 640, 960); this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; } else { this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.setMinMax(160, 240, 640, 960); this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.forceOrientation(true, false); this.scale.setResizeCallback(this.gameResized, this); this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this); this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this); } }Code sample from phaser.io 'examples': var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });function preload() { game.load.atlasJSONHash('bot', 'assets/sprites/running_bot.png', 'assets/sprites/running_bot.json');}var s;function create() { s = game.add.sprite(game.world.centerX, game.world.centerY, 'bot'); s.anchor.setTo(0.5, 0.5); s.scale.setTo(2, 2); s.animations.add('run'); s.animations.play('run', 10, true);}What difference does this make? Why do I have to use it? Is it considered 'best practice'? Does it affect anything if I don't include it?
×
×
  • Create New...