Discuss Scratch

potatobatman11
Scratcher
10 posts

help meh plz!

i am very new to scratch and i am trying to perfect the game of pong as a learning experience, i am stuck on a few things, i cant figure out how to get the paddle to work as a CPU so you wont have to play against your self and i cant figure out how to add a point limit so the game will stop if you reach so much points, if i can get some help that would be great, thank you
Davidtcg
Scratcher
40 posts

help meh plz!

You upload I will make the changes in remix
potatobatman11
Scratcher
10 posts

help meh plz!

i think i have, i shared it so you check it out on my acount http://scratch.mit.edu.ezproxyberklee.flo.org/users/Davidtcg/
drmcw
Scratcher
1000+ posts

help meh plz!

For a cpu paddle then something like;
In the bat scripts;
if y position of ball > y position of bat then
change y by someamount
else
change y by -someamount

The bigger someamount is the faster the cpu bat will move. You could also surround the above script with an if random 1 to 100 > 25 then in this case the cpu will move 75 % of the time so you can make the cpu play better of worse by changing those numbers too.



For points make a variable called points; You then need to initialise points to 0 when gf flag clicked and change points by 1 at some point too.

If you don't have a main game loop then put this in a forever block on the stage;

if points > limit
stop all scripts

Last edited by drmcw (July 11, 2013 06:52:11)

potatobatman11
Scratcher
10 posts

help meh plz!

i am very new to scratch and i am trying to perfect the game of pong as a learning experience, i am stuck on a few things, i cant figure out how to get the paddle to work as a CPU so you wont have to play against your self and i cant figure out how to add a point limit so the game will stop if you reach so much points, if i can get some help that would be great, thank you
RUBIXS
New Scratcher
60 posts

help meh plz!

could you share the project so we could get an idea on how exactly to help
potatobatman11
Scratcher
10 posts

help meh plz!

i have go check my account

Last edited by potatobatman11 (July 12, 2013 04:23:27)

drmcw
Scratcher
1000+ posts

help meh plz!

potatobatman11
Scratcher
10 posts

help meh plz!

@drmcw what's a bat?
AgentRoop
Scratcher
100+ posts

help meh plz!

potatobatman11 wrote:

@drmcw what's a bat?
they probably mean the CPU's board.
drmcw
Scratcher
1000+ posts

help meh plz!

AgentRoop wrote:

potatobatman11 wrote:

@drmcw what's a bat?
they probably mean the CPU's board.
bat=paddle=board=racquet=thing that hit's the ball!
AgentRoop
Scratcher
100+ posts

help meh plz!

drmcw wrote:

AgentRoop wrote:

potatobatman11 wrote:

@drmcw what's a bat?
they probably mean the CPU's board.
bat=paddle=board=racquet=thing that hit's the ball!
yes, that!

Powered by DjangoBB