Search the Community

Showing results for tags 'best practice'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 5 results

  1. In the game "Monster Wants Candy," I see this in the source code, and I was wondering why this was done. I've tried doing this myself but keep failing. This is what I mean: var Candy = {}; Candy.Boot = function(game){}; Candy.Boot.prototype = { preload: function(){ // preload the loading indicator first before anything else this.load.image('preloaderBar', 'img/loading-bar.png'); }, create: function(){ // set scale options this.input.maxPointers = 1; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.setScreenSize(true); // start the Preloader state this.state.start('Preloader'); } }; (source: var gameWidth = 800, gameHeight = 600; var game = new Phaser.Game(gameWidth, gameHeight, Phaser.AUTO), BootState = function () {}, gameOptions = { playSound: true, playMusic: true }, musicPlayer; BootState.prototype = { preload: function () {'loadingbar', 'assets/images/loadingbar.png');'logo', 'assets/images/logo2.png');'LoadState', 'js/gamestates/LoadState.js');'pollyfill', 'js/lib/pollyfill.js');'utils', 'js/lib/utils.js'); }, create: function () { game.renderer.renderSession.roundPixels = true; Phaser.Canvas.setImageRenderingCrisp(;'LoadState', LoadState);'LoadState'); } };'BootState', BootState);"BootState"); I also note that I don't take "Game" as an argument in my game state functions, unlike Monster Wants Candy which has the argument "game" in it's bootstate. Have I been doing something wrong? I'm following most of the tutorials and example code I've seen so far, though I am aware those may not always be good examples of best practice. Thanks in advance for replies and sorry for the long post. I'm a bit of a JS and Phaser noob, I'm mainly just aiming to learn good practice with this project.
  2. Say i have an animation that suppose to run in the background as the background itself while the game still playing. What is the best practice to play large animation? By large animation I mean: - animation resolution greater that 500X500 px - very long animations (much frames, more than 24) By best practice I mean: - play in good performance while not interrupting the game performance - what type of animation to use (atlas? sprite-sheet? mp4? different method?) - how to load it in phaser - how to implement it in phaser I also would like to know if there is a better profiler tool than phaser-debug that also shows the graphic-card's memory usage.
  3. Has any best practice for renderig a lot of pixes (dots) with updating colors dynamicly? Like falling stars or roket flame by pixel partials. Can anybody help me? Here is example of that whot i wont to do its work, but i wont do it faster, cose will be more then one object like this. Sorry for bad lang
  4. Hello! I'm migrating from AS3 to HTML5 and decided to use Phaser. That's great, many thanks for creating it! I have a question about organizing the MouseDown event listener. Let's say I have 100 sprites on the screen, and if the player click on any of them, the sprite's data should be traced. In AS3 adding event listener to each of the sprites I could do: stage.addEventListener(MouseEvent.MOUSE_DOWN, onMDown);......private function onMDown(e:MouseEvent):void{ if ( is Sprite){ trace("you clicked on: "+( as Sprite).name); }}Is there such a way in Phaser? I understand, that when creating these sprites in Phaser I have to do: for (var i=0; i<100; i++){ var spr = game.add.sprite(Math.random()*600,Math.random()*400,'PIC_SPRITE'); = 'Sprite'+i; spr.inputEnabled = true; spr.input.start(0, true);, this);}...function onMDown(item, pointer){ console.log('you clicked on ';}So, I wonder, do I really need to add onInputDown to each sprite? Perhaps, the same effect could be achieved by adding a single function to game.input.onDown, like I did in AS3 adding a single function to stage onMouseDown?
  5. I can't find a good answer to this question. I want to create an HTML5 game with phaser framework and convert it into Android/iOS app (webview). The game suppose to work a lot with database (update, select) Do any one can suggest me the right way to work to be able after that to convert it with minimal time wasting? Thanks