Page 1 of 1

need help with pong game

PostPosted: Sat Aug 04, 2007 12:37 pm
by jman
i dont know how to make the opponents paddle block the ball

PostPosted: Sat Aug 04, 2007 12:48 pm
by pixelpoop
in the script editor on the draw event of the opponents paddle put:

if (ball_name.y<y){y-=1;}else{y+=1;}


change ball_name to the name of your ball actor.
change the 1 to whatever speed you want the opponents paddle to move.

PostPosted: Sat Aug 04, 2007 12:50 pm
by pixelpoop
you also need a physical responce on the ball if you don't have one already. Look under the Help menu for a tutorial.

PostPosted: Sat Aug 04, 2007 2:18 pm
by Freddy
I have the perfect thing for you. If you want you can just copy and paste this code to the draw actor event of the computer player.

int weight = 10;
x = ((weight -1)*x + Ball.x)/weight;

Change the 10 to a different number to adjust the speed of the opponent. You'll have to change the word Ball to whatever you called the ball in your game. Hope this helps :D .

Re: need help with pong game

PostPosted: Sun Aug 05, 2007 1:18 am
by Sgt. Sparky
your Icon is the Frog off of my Frogger Game. :D

PostPosted: Sun Aug 05, 2007 1:54 am
by d-soldier
You can't be sure, it could be any frog... :D

Re: need help with pong game

PostPosted: Sun Aug 05, 2007 9:42 pm
by jman
Sgt. Sparky wrote:your Icon is the Frog off of my Frogger Game. :D


srry
sgt. sparky

PostPosted: Sun Aug 05, 2007 9:44 pm
by jman
i like it

PostPosted: Mon Aug 06, 2007 1:59 am
by jman
thanks

PostPosted: Mon Aug 06, 2007 10:35 am
by jman
how do you make it so when a counter reaches 10 an "you win" comes to 0,0
on the screen

PostPosted: Mon Aug 06, 2007 11:56 am
by jman
how do you make it so when a counter reaches 10 an "you win" comes to 0,0
on the screen
:D

PostPosted: Mon Aug 06, 2007 12:28 pm
by jman
thanx this is it :D