How to make a game over statement after object is being collided to a player

Hi badly need your help. Im just a beginner and I coundn’t run my application as Im doing a game. where in if falling object from above hits the player game will end with a message “game over”

1 Like

Set a marker to true when the player is hit

For example:

Before setup() boolean gameOver=false;

upon collision: gameOver=true;

In draw():

if(gameOver) {text("game over ",77,77);
}else {
// what you have in draw () now
}
1 Like

Is there any easiest way to explain it? sorry for the trouble. I just couldnt get it so well

1 Like

Set a marker to true when the player is hit

Evaluate the marker so draw has two different
states what it does

do you have any sample codes for that?

Lyca,

How do you test that the falling object has hit the player? Could you show the code?
Then we could let you know, where to enter @Chrisir 's line of code.

Thanks,
Frank