Jump to content

Search the Community

Showing results for tags 'setScene'.

  • 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. Phempt

    Bug or?

    This is the working code: game.module('game.main').require('game.assets').body(function() {game.createScene('Main', { backgroundColor: 0x000000, init: function() { this.terrain = new game.Sprite("world/terrain.png"); this.terrain.position.set(0, game.system.height - this.terrain.height); this.terrain.interactive = true; this.stage.addChild(this.terrain); this.terrain.touchstart = this.terrain.click = function(){ game.system.setScene("Game"); } },});game.createScene('Game', { backgroundColor: 0x000000, birdsArray: [], init: function(){ /* WORLD & CONTAINERS */ this.world = new game.World(0, 9); this.world.ratio = 1; /* CONTAINER */ this.bgContainer = new game.Container(); this.bgContainer.addTo(this.stage); this.topBar = new game.Container(); this.topBar.addTo(this.stage); /* CLOUDS */ this.addParallax(0, 'world/clouds.png', -35); /* ADD BG IMAGES AND WORLD IMAGES */ this.citybg = new game.Sprite("world/backCity.png"); this.addParallax(game.system.height - this.citybg.height, 'world/backCity.png', 5); this.terrain = new game.Sprite("world/terrain.png"); this.addParallax(game.system.height - this.terrain.height, 'world/terrain.png', 25); /* TUBES SPAWN */ this.birdsGenerator(); }, birdsGenerator: function() { console.log('spawn'); this.addTimer(1000, this.birdsGenerator.bind(this)); }, addParallax: function(y, path, speed) { var parallax = new game.TilingSprite(path); parallax.position.y = y; parallax.speed.x = speed; parallax.addTo(this.bgContainer); this.addObject(parallax); } });});but if in the main scene I change the init function simply with: init: function() { game.system.setScene("Game"); },the game scene doesn't work properly, for example the function parallax is not working as expected (no movement).
×
×
  • Create New...