This site requires JavaScript, please enable it in your browser!
Greenfoot back
Ipurplish
Ipurplish wrote ...

2019/1/22

How do I change the MyWorld Image MidGame?

Ipurplish Ipurplish

2019/1/22

#
I put in an act method into my World class, and I have this code: public class StartWorld extends World { int cycles=0; int picture=1; public StartWorld() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(600, 400, 1); } public void act() { cycles++; if(cycles%10==0) { picture++; } if(picture==1) { (this).setImage("StartGame.png"); } else if(picture==2) { (this).setImage("StartGame2.png"); } } } why doesn't this work?
danpost danpost

2019/1/22

#
The World class method to set its image is not setImage.
Ipurplish Ipurplish

2019/1/22

#
what is it then?
danpost danpost

2019/1/22

#
Ipurplish wrote...
what is it then?
Please refer to the World class documentation.
You need to login to post a reply.