need help with pong game

Talk about making games.

need help with pong game

Postby jman » Sat Aug 04, 2007 12:37 pm

i dont know how to make the opponents paddle block the ball
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Postby pixelpoop » Sat Aug 04, 2007 12:48 pm

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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby pixelpoop » Sat Aug 04, 2007 12:50 pm

you also need a physical responce on the ball if you don't have one already. Look under the Help menu for a tutorial.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby Freddy » Sat Aug 04, 2007 2:18 pm

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 .
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Re: need help with pong game

Postby Sgt. Sparky » Sun Aug 05, 2007 1:18 am

your Icon is the Frog off of my Frogger Game. :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby d-soldier » Sun Aug 05, 2007 1:54 am

You can't be sure, it could be any frog... :D
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Re: need help with pong game

Postby jman » Sun Aug 05, 2007 9:42 pm

Sgt. Sparky wrote:your Icon is the Frog off of my Frogger Game. :D


srry
sgt. sparky
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Postby jman » Sun Aug 05, 2007 9:44 pm

i like it
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Postby jman » Mon Aug 06, 2007 1:59 am

thanks
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Postby jman » Mon Aug 06, 2007 10:35 am

how do you make it so when a counter reaches 10 an "you win" comes to 0,0
on the screen
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Postby jman » Mon Aug 06, 2007 11:56 am

how do you make it so when a counter reaches 10 an "you win" comes to 0,0
on the screen
:D
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Postby jman » Mon Aug 06, 2007 12:28 pm

thanx this is it :D
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron