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.

Work in Progress / My C++ Pong game!

Author
Message
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 30th Dec 2005 12:48 Edited at: 30th Dec 2005 12:49
Pong. The most original game ever

Not exactly dbp/dbc or even dgsdk, but hopefully the mods won't mind me posting the progress of my first (decent) playable C++ game here.

Its not much (pong of course) but it definately beats trying to make an MMORPG as a newbie C++ programmer

Ok, let's get down to the screenies and a playable demo



So, how does it work? Well, its just a simple vesion of pong, with one and two player games availible. The grid shape in the middle changes colour with who's winning (I haven't got the hang of text output yet) and the game just plays and plays until you exit.

The AI is what I'm most proud of here A may be a newbie C++'er but I didn't go lightly on the AI

Playable demo will be added shortly

Quote: "Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all."

Attachments

Login to view attachments
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 30th Dec 2005 12:58 Edited at: 30th Dec 2005 13:00
Playable demo time!

350kb.
http://forum.thegamecreators.com/xt/xt_apollo_download.php?i=743880

Controls

Player 1 (left hand side paddle)
A to move up
Z to move down.

Or player 1 can use the mouse to move up/down

Player 2 (right hand side in a two-player game)
Home to move up
End to move down


Notes

Your given the option of a one-player game or two-player game when the app starts

Let the app initialise properly before trying to press [escape] otherwise it'll crash (yes, that is a bug)

When your finished playing, press [escape] to leave the game.

Collision detection is a bit weird at the moment, and may not detect some collisions between the bal/paddle/wall

Paddles can move outside of screen area on some circumstances

ENJOY!

Quote: "Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all."

Attachments

Login to view attachments
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 30th Dec 2005 13:04
I dont mind i can imagine programming something in C++ will be dead hard so you should be commended on your efforts, looks good


[img]

[/img]
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Dec 2005 15:21
Did you use MS Paint for that background? The bottom of that vertical line looks very paint-like

Looks cool anyway.

TKsFox
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 30th Dec 2005 16:39
Looks MS like - shapes

It's me...
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 30th Dec 2005 20:07
did you use OpenGL? or DirectX? or something else...

i made a pong game using OpenGL... but i used ASCII characters because i never got the hang of loading images...

It looks pretty good though! You might want to add a score "board" at the top now? (just some text like "4 - 6"...)

--Peter

"We make the worst games in the universe..."
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 30th Dec 2005 20:28 Edited at: 30th Dec 2005 20:34
Quote: "commended on your efforts, looks good "


Why thank-you


Quote: "MS Paint for that background?"

Quote: "Looks MS like - shapes"


Yes, sadly I did stoop to the level of using ms paint My main PC is out cold, so I'm using my backup machine, which has no paintshop pro or otherwise

Quote: "did you use OpenGL? or DirectX? or something else... "

Indeed, I did use something else: Allegro.
As long as you can figure out double buffering etc, it is as easy as pie for 2d stuff. I managed to pick it up and get it working in under a day. Then I started working on this game (which took 2 days in total).

Oh yeah, and I'm hoping to do a few more tutorials in allegro, so I can get the hang of text output (and do a scoreboard).

Thanks for the input everybody

EDIT: For any allegro newbies out there, who are interested in how double-buffering works, it is actually hideously simple;


Basically, that code blits the main screen to the buffer, draws the sprites to the buffer (of course you'll need a *buffer BITMAP somewhere) and then blits the buffer to the screen.

Of course, you then need to clear the buffer, so my code increments a time (buffer_tick). Once it equals 5, the ticker is reset, and the buffer is cleared. (If you clear it every loop, it interferes with midi files)

Quote: "Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all."
Les Horribres
18
Years of Service
User Offline
Joined: 20th Nov 2005
Location: My Name is... Merry
Posted: 30th Dec 2005 21:38
Since it is merely a pong game, how about you release your souce. Some people may be able to offer you pointers.

Merranvo, The Cool One

Anti-Noob Justice League, an ANJL of Mercy.
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 30th Dec 2005 21:45
Quote: "Allegro"

use directx - that's where the fun begins


amd athlon xp 2600+,1280mb,FX 5200 128mb,200gb,xp pro sp2
MastaBetty
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 9th Jan 2006 23:15
ahh i am learning allegro... along with the basics of C++...lol
[u]
RavageFX
18
Years of Service
User Offline
Joined: 20th Jan 2006
Location:
Posted: 9th Feb 2006 17:46
I tried allegro but then when DBPro about a year ago. I found DBPro alot easier to use but the allegro is way easier then DirectX

Dont eat a cheese at night. Or you'll meet me.

Login to post a reply

Server time is: 2024-09-29 10:29:36
Your offset time is: 2024-09-29 10:29:36