TheScruffyGuy

Game Object not being removed after code is deleted

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();
		
	}	

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.