Jump to content

Game Object not being removed after code is deleted


TheScruffyGuy
 Share

Recommended Posts

I am trying to learn Phaser 3 and I have created ground object 100x100px ground object to randomize, I decided  to scarp that and made a image the length I need but now the old image wont change and the second ground object I created is still on the game screen even after I had erased the code. I even went as far as removing its image from function preload().

I am saving the code after every alteration.

 

var game = new Phaser.Game(config);

    function preload ()
    {
		this.load.image('bulld', 'assets/images/bulldozer.png');
		this.load.image('world', 'assets/images/background1.png');
		this.load.image('rock1', 'assets/images/rock1.png');
		this.load.image('grnd1', 'assets/images/ground1.png');
		
    }

    function create ()
    {
		this.add.image(550,350, 'world');
		
		rocks = this.physics.add.sprite(550, 540, 'rock1');
		
		rocks.setBounce(0.1);
		rocks.setCollideWorldBounds(true);
		
		ground = this.physics.add.staticGroup();
		
		ground.create(400, 652, 'grnd1').setScale(0.27).refreshBody();
		
	}	

 

Link to comment
Share on other sites

Hello @onlycape,

 

I ended up deleting everything that referenced any objects related to the problem, refreshed the page then reinstalled it and it cleared the problem so I am pretty sure your right about it being a browser cache issue. I have since finished my first "game" and am working on something a little more difficult.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...