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

2020/1/15

How to make ball reset back to middle after hitting the wall and game over screen?

sisi12 sisi12

2020/1/15

#
Hello, I am currently coding a Pong game and I need some help on how to set the ball back in the middle after hitting the walls of the left and right side. I would also like some help on how does one make a game over screen when for example Player1 has reached a certain score, it shows, "Game Over! Player 1 wins!"
KylesGallery KylesGallery

2020/1/15

#
Try making score a public static int and adding a new world with your game over screen set as the background PNG file heres what you might do to output the score setImage(new GreenfootImage("Your Final Score Is : " + actor.score, 15/*size of text*/, Color.RED/*Font Color*/, Color.DARK_GRAY/*Background Text Color*/));
You need to login to post a reply.