Discuss Scratch

EduardAreny
Scratcher
4 posts

Coordinate speed with score (Pong)

Hi everyone,

I am doing a version of the famous game called “Pong”. I'm a bit noob in Scratch.
I have all the game completed, but I want that every time I score +10 points, the paddle get smaller. (Reduce the paddle 5% every 10 points).
The other problem is that I want the ball go a bit faster every time I also score 10 points. I've tried a lot of things to do that but they doesn't work, I don't know what to do more. I know how to do it when I have 10 points, but not when i score 20, 30, 40,…

I would appreciate an answer.
https://scratch.mit.edu/projects/439054919
Here is my project (is in Catalan).

Thanks,
Eduard.

Last edited by EduardAreny (Nov. 5, 2020 13:32:35)

yippymishy
Scratcher
100+ posts

Coordinate speed with score (Pong)

when green flag clicked
set size to (100) %
set [speed v] to [5]
set [score v] to [0]
forever
if <<((score) mod (10)) = [0]> and <(score) > [0]>> then
change size by (-5)
change [speed v] by (5)
wait until <not <((score) mod (10)) = [0]>>
end
end
JollyWinter
Scratcher
100+ posts

Coordinate speed with score (Pong)

I hope that this helps, I've taken and used some math to set the size of the paddle and set the speed of the potato

https://scratch.mit.edu/projects/445701394/
EduardAreny
Scratcher
4 posts

Coordinate speed with score (Pong)

Thanks everyone! That really helped me JollyWinter and yippymishy!
Greetings from Spain!

Powered by DjangoBB