Jump to content

Search the Community

Showing results for tags 'separate javascript file'.

  • 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. Now I have only one javascript file which included many states there. Here is my sample code: var WelcomeState = { preload: function () { game.load.image('bg1', 'games/RockPaperScissors/assets/Game0002.png'); }, create: function () { game.add.sprite(0, 0, 'bg1'); }, start: function () { this.game.state.start('instruct'); }// other methods....};var InstructState = { preload: function () { game.load.image('bg2', 'games/RockPaperScissors/assets/Game0001.png'); game.load.image('guide', 'games/RockPaperScissors/assets/Game0015.png'); game.load.spritesheet('readyPlay', 'games/RockPaperScissors/assets/ready.png', 130, 46); }, readyPlay: function () { this.game.state.start('rockpaperscissor'); }// other methods....};var game = new Phaser.Game(480, 360, Phaser.AUTO, 'game_container', null, false, false);game.state.add('welcome', WelcomeState);game.state.add('instruct', InstructState);game.state.start('welcome');Can anyone tell me the best practice way to separate Javascript file in order to get better performance of the game?
×
×
  • Create New...