Scrolling Game Development Kit Forum

SGDK Version 1 => Projects => Topic started by: Gohst on 2008-03-04, 02:14:43 AM

Title: 2-Player Pong
Post by: Gohst on 2008-03-04, 02:14:43 AM
This was years ago, but since I've just gotten back on the wagon, so to speak, I thought I'd mention it...

For a laugh, and a bit of a challenge, I thought I'd make a two player game. I settled on Pong, because it was simple enough. The left paddle was controlled with two of the letter keys and the right paddle was up and down. One character was a player, but the other was a sprite. By pressing the correct key, it "moved" up, or down.

The "border" of the game was a sprite. Because I couldn't simply make a tile to bounce a sprite off, it had to be this way. For some reason I did it a certain way that each horizontal line at the top and bottom of the screen had to be three sprites, two of equal length and one extra. The ball, when it hit invisible sprites on the left and right of screen would add a score to the correct side. Then it would start from on one of three paths and it had 100% inertia, so it kept going.

Unfortunately, the game was very dull. It didn't move fast and every time you hit it, or it hit something, it bounced at exactly 45-degrees. The reason I didn't post it was because if it hit one of the three wall sections (either on top or bottom) it would shift that section of line out of whack. I never posted it, because I couldn't fix it and didn't want to post an unfinished example, no matter how ambitious two-player was.

I am pretty sure the project has been lost to the ages now.
Title: Re: 2-Player Pong
Post by: Jam0864 on 2008-03-04, 02:20:34 AM
This is something that needs to be added to SGDK2 -- more collision stuff, like the original that had bouncing. :(

Title: Re: 2-Player Pong
Post by: bluemonkmn on 2008-03-04, 07:52:30 AM
As you can see, the bouncing in the original didn't work very well.  Bouncing in version 2 would not be that complicated.  The actual bounce part (verticallly) could be done with one simple rule without using extra sprites:
Function: =
Value: -dy
Output to: dy

That will bounce the sprite vertically.

You could probably make the sprite bounce of all solid walls by using rules like that in combination with IsBlocked.  It would be simpler and probably more reliable than any bouncing mechanism available in version 1.
Title: Re: 2-Player Pong
Post by: marine1 on 2010-04-16, 05:41:32 PM
hey this stuff you guys are talking about is very intresting  i cant wait till it starts making since to me  ???