cortex Posted April 26, 2014 Share Posted April 26, 2014 I have a problem with changing the state. All sprites "fall" off the screen right after the (second)screen has changed. Only that "this.text" works, which is a string text! What to do?! create: function() { currentstate = "screen1_state"; game.world.setBounds(0, 0, 800, 600); // We're going to be using physics, so enable the Arcade Physics system this.game.physics.startSystem(Phaser.Physics.ARCADE); map = game.add.tilemap('map2'); map.addTilesetImage('free_tileset_4', 'tileset2'); layerColl = map.createLayer(1);//collision layer - draw it first if you dont want to see it map.setCollision(1, true, layerColl); var layer0 = map.createLayer(0);//ground layer var layer1 = map.createLayer(1);//lower body var layer2 = map.createLayer(2);//upper body var style = {font: "20px verdana", fill: "#ffffff"}; this.scoreText = game.add.text(700, 10, "Score: " + score, style); this.text = this.game.add.text(20, 430, "Move with arrows", style); this.bottle = this.game.add.sprite(450, 250, 'item'); this.hole = this.game.add.sprite(750, 450, 'item2'); Link to comment Share on other sites More sharing options...
cortex Posted April 27, 2014 Author Share Posted April 27, 2014 The problem was game.world.setBounds(0, 0, 800, 600); How do I use this? Without this the game works, but the area is too small when it should be (0, 0, 1920, 960);on the other screen. Link to comment Share on other sites More sharing options...
Recommended Posts