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

2019/2/20

Random Sprite placement?

BasicCode BasicCode

2019/2/20

#
Im trying to make a little clicker game for a project, but i have an issue where i cant figuire out how to place a random sprites in the same position after one has been "Defeated". (Also, i have an issue where i have made a button that whenever its clicked, it should change the scene, however it seems to happen whenever i select run, and not when i click the button. ) if (Greenfoot.mousePressed(this)); Greenfoot.setWorld(new BattleScreen()) The code for the button
danpost danpost

2019/2/20

#
BasicCode wrote...
Im trying to make a little clicker game for a project, but i have an issue where i cant figuire out how to place a random sprites in the same position after one has been "Defeated".
Add a public method in your world class to add one of these sprites into the world and always use it to do so.
(Also, i have an issue where i have made a button that whenever its clicked, it should change the scene, however it seems to happen whenever i select run, and not when i click the button. ) << Code Omitted >> The code for the button
Check your code to see if you are using the second line elsewhere.
BasicCode BasicCode

2019/2/21

#
Thanks for that, ill be sure to try it out
You need to login to post a reply.