We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So, i have this arkanoid game which is ready, but i need to do some extra things that i cannot do and i would like you to help me.
I have to:
-Set up a scoring system - When the ball is out of the screen, end the game - The slider must to get smaller, in relation to time ( permanent deformation)
You could save me if you could help me
Thank you
Answers
Always when being confronted with a new task you need to ask yourself, what is the context, what is the exact meaning of the task, what are the single steps to reach the goal. Break the problem down into single steps.
Set up a scoring system
you need a variable
int score = 0;
when the ball hits a brick say
score++;
display the score in the corner with
text()
When the ball is out of the screen, end the game
you need a state system to be able to display a game over screen when the ball is out of the screen. So let's say your state is a variable of type int. And it can be 0 for GAME or 1 for GAMEOVER.
So when the ball leaves the screen say
state = 1;
in draw()
have
(alternatively
lives--;
(and reset ball have a short screen displayed)(lives == 0)
set game over;lives=3;
)
The slider must get smaller, in relation to time ( permanent deformation):