Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Pong Problems

Author
Message
SkunkMan
21
Years of Service
User Offline
Joined: 11th Jun 2003
Location:
Posted: 19th Jun 2003 23:14
Hi!

I started to make pong because I never programmed a game. There are to little paddles on the sides of the screen so far. I want to know how to make boudries and change the color of the paddles.

Thanks
Phoenix
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 19th Jun 2003 23:25
Just open up paint or something and draw a box the color you want the paddles and then just load it as a bitmap. That way you can use collisions and if you detect collision then you can have the ball bounce off but you'll have to make the ball a bitmap to. To make boundries you could just use the commands to draw another box but when I made Pong I just also used another Bitmap for the lines at the top and bottom it's much easier For collision purposes.

position object myFoot,object position x(yourFace),object position y(yourFace),object position z(yourFace)
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 19th Jun 2003 23:32
If you are using the db 2d commands to draw the paddles use the ink command to change the colours.

You can make the boundtries in a few different ways. You could have lines as sprties and check for collision with the ball. You could also check if the ball is near the edge and then make it reverse direction.
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 20th Jun 2003 02:26
Sprite collision for boundaries?
I'd just use a variable for the position of the ball and if it's too far over either side then it hits the boundaries. Then you can check it's y position to see if it will hit the paddle. Sounds simple enough to me.

If you can't beat them, use a stick.

Login to post a reply

Server time is: 2024-09-20 11:37:22
Your offset time is: 2024-09-20 11:37:22