Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Let there be tennis!

Finished making your own program (thats not part of the practicing forums) ? Show it off here

Let there be tennis!

Postby vEjEsE on Wed Nov 04, 2009 11:09 am

Hello fellow programmers and noob friends, chch.

I am sharing my pong game with you (not for your benefit, but for mine) so that you can criticize me all you want.
It's a WIP, I just messed up my algorithm.

Ah, if there's interest on the code source to, I will post it, now I'm on an other PC, no C++ here :-<

So, here we go.
Debug.zip
(407.19 KiB) Downloaded 33 times
Does a universe exist if there is no life to acknowledge it's existence?
User avatar
vEjEsE
 
Posts: 27
Joined: Mon Aug 03, 2009 12:48 am

Re: Let there be tennis!

Postby glinka57 on Wed Nov 04, 2009 12:54 pm

Mwahahahhaha VERY NICE, this is awsome, finally a game of ours that I can play when Im bored XD.
I only played for 5 minutes and it seems the computer never misses, can it?
how did you set the angle of deflections on impact (is it just random or is there something to it?)

I noticed you made the speed increment steadily, does it?

nice work on making the computer wait untill the ball reaches his half before moving, and on 'seemingly' hesitating and going the wrong way for a while lol, what was the code like for that,
did u make the components from scratch?
User avatar
glinka57
 
Posts: 149
Joined: Fri Feb 27, 2009 7:32 pm

Re: Let there be tennis!

Postby vEjEsE on Wed Nov 04, 2009 1:09 pm

Wooh!

It's actually buggy.

The AI can lose, it has a steady up and down movement, if the ball moves faster up/down then the AI pad, AI will lose.

There actually are no angels, there are speeds on both axes, X and Y, when the ball hits the upper/lower limit, it just mutiplyes the Y speed with -1 (to go from negative to positive, viceversa), it just gives a impresion that it's funky xD

Uh, thanks for the 'seemingly', I was after that.

It's all scratch, primitives from allegro ftw!

Thanks. Will post the source code soon, later this day.


Later edit:
Here is the code, a archive, there are 6-7-8 files:
Tennis.zip
(432.5 KiB) Downloaded 11 times
Does a universe exist if there is no life to acknowledge it's existence?
User avatar
vEjEsE
 
Posts: 27
Joined: Mon Aug 03, 2009 12:48 am

Re: Let there be tennis!

Postby antiRTFM on Wed Nov 04, 2009 5:30 pm

'AI can lose' is actually a good thing, i think

All in all very impressive. Good job!
User avatar
antiRTFM
Administrator
 
Posts: 456
Joined: Sun Apr 13, 2008 9:10 am

Re: Let there be tennis!

Postby noobgrammer on Thu Nov 05, 2009 1:36 pm

I played it and made a few scores
It looks cool but I haven't looked at the code to see how you did it but from the play it seems like its working well
nice job
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 170
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Let there be tennis!

Postby vEjEsE on Fri Nov 06, 2009 5:40 am

Thanks guys.

But I need input to, it's well structured, I tryied an OO aproach, did I succeed? Am I a noob? Does my english suck?!


Thanks again. I need to fix up my algorithm a bit for the score and some pause for the ball...
Does a universe exist if there is no life to acknowledge it's existence?
User avatar
vEjEsE
 
Posts: 27
Joined: Mon Aug 03, 2009 12:48 am

Re: Let there be tennis!

Postby Vevix on Fri Nov 06, 2009 9:01 am

Only had a quick look, but your .h files need associated .cpp files, Don't do it all in the .h file
User avatar
Vevix
 
Posts: 58
Joined: Sat Oct 10, 2009 9:24 pm
Location: ntdll.dll

Re: Let there be tennis!

Postby DevGeek++ on Fri Nov 06, 2009 10:22 am

Awesome,i wish i can do such game some day :)
DevGeek++
 
Posts: 28
Joined: Tue Aug 04, 2009 5:54 am


Return to Full programs

Who is online

Users browsing this forum: No registered users and 0 guests