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

2013/7/4

PLEASE HELP

fredold44 fredold44

2013/7/4

#
i need help making a image witch says GAME OVER (witch i already have) come up when you get eaten, i'm new to this and i have no idea.
To create an image that can be used for actors, the world background, etc. create a line like this:
GreenfootImage img = new GreenfootImage(/*YourImageName.fileExtension*/);
To use it:
//For actors
setImage(img);
//Note: you can also right click the actor's class, and if you click on "Set Image" greenfoot will do this for you (and it gives you a thumbnail of what the actor looks like)

//For the world
setBackground(img);
So if you create an actor called gameover, and set it's image to your game over image, you can spawn the GameOver actor when it's game over. If you want to use an image in your code, make sure that the images are in your image folder of you greenfoot project folder. Otherwise, if you are setting the image from right clicking the actor, there is an option in the bottom right that says "Import from File" That will allow you to choose a picture from anywhere, and it will copy that picture into your image folder.
fredold44 fredold44

2013/7/4

#
thank you very much
You need to login to post a reply.