This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-05 14:01:46

BelugaBoyP2
Scratcher
Registered: 2012-02-27
Posts: 3

Impossible Pong- Want to be not impossible

My game, Impossible Pong, is impossible to beat w/o glitches. Now that I have an idea of what the script looks like, I would like to make it possible. The problem is, the CPU's y axis
is always EXACTLY the y axis of the ball. Is there any way to make it so that the CPU travels to the ball's y axis more slowly, so the ball can get to the wall sprite that lets the Player get points? Thanks a lot, in advance.

Offline

 

#2 2012-04-05 14:04:37

pi3
Scratcher
Registered: 2011-12-31
Posts: 500+

Re: Impossible Pong- Want to be not impossible

This should help.


http://i44.tinypic.com/ofdhc4.jpgThanks FreshStudios!

Offline

 

#3 2012-04-06 13:05:51

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Impossible Pong- Want to be not impossible

I have a beatable pong game, it uses this:

when gf clicked
forever
   glide <(distancetoball) / (difficulty)> secs to x = (xpos on screen) y = (y position of ball)
a hard difficulty for a ball going 10 steps is about 550-700


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#4 2012-04-06 13:29:37

aryabtsev
Scratcher
Registered: 2012-02-05
Posts: 81

Re: Impossible Pong- Want to be not impossible

Instead of

set x to ([x position v] of [ball v])
Use
glide (0.05) secs to x: ([x position v] of [ball v]) y: (y position)


http://i.imgur.com/NX7AO.jpg

Offline

 

#5 2012-04-06 13:42:58

FreshStudios
Scratcher
Registered: 2011-04-11
Posts: 500+

Re: Impossible Pong- Want to be not impossible

Maybe you should look at some other pong projects. Like the example one!


http://i43.tinypic.com/24ymnbn.png

Offline

 

#6 2012-04-09 14:07:37

BelugaBoyP2
Scratcher
Registered: 2012-02-27
Posts: 3

Re: Impossible Pong- Want to be not impossible

Thanks everybody! Y'all really helped!

Offline

 

#7 2012-04-09 18:26:37

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: Impossible Pong- Want to be not impossible

Or you could use the old fashioned "easing" method:

when gf clicked
forever
  change x by (((mouse x) - (x position)) * ((1)/((20)-(difficulty))))
end
Just make sure to change the 20 to 1+the maximum level you want. If you don't Scratch will compute 1/0 and cause an error.  sad .

edit: GRR STUPID SCRATCHBLOCKS >:-(
edit again: Yay, figured them out! Just needed parenthesis.  smile

Last edited by scratchisthebest (2012-04-09 18:32:12)


bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

Board footer