Post: Game: Ping Pong Win32 (C++) ::With source code
01-30-2011, 09:49 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); This was quite epic to make.

I've based the menu system of the header file drawMenu.h which i created a while back for my college programs. I recently learnt how to play .wav sounds in C++ console, so i decided to make Ping Pong Happy

You must login or register to view this content.

If you see any code in here you need explaining so you can replicate it in your own programs, just ask.
Last edited by TheUberFail ; 01-31-2011 at 11:47 AM.
01-30-2011, 10:56 PM #2
Dingus98
[move]fuk up m8[/move]
ill download now and see how it is!
01-30-2011, 11:06 PM #3
Millz
Worth the Weight
=D I spent a good 2 hours playing this, I need a break.

Very nice job btw. :y:
01-30-2011, 11:23 PM #4
El Violador
< ^ > < ^ >
is it really slow or is it just me? anyways very good i wish i could code like that Smile
01-31-2011, 12:37 AM #5
Originally posted by Ar88rA View Post
is it really slow or is it just me? anyways very good i wish i could code like that Smile


I must admit, the programming was really not efficient, when i coded it i was on a fast computer so i dident notice :( but now im on my home PC, it lags a bit. But anyway, it works :P.

You can easly create a menu system like you see in this program, the drawMenu.h header file is in the source code, at the start of your C++ program, write

    #include "drawMenu.h"


Make sure to have drawMenu.h in the same folder as your program you are writting.

Syntax: drawMenu("Message to ask","Options|Sperated|Like|This",1);

The last number is how many tabs you want to to tab across the screen. 0, means the message to ask is at the far left of the console, and the menu items are always 1 tab from the left to the message to ask.

Heres the how i created the menu system for the ping pong

    switch(drawMenu(menuMsg,"Play|Select Difficulty|Exit",1))
{
case 1: menuClick();handel(dif);break;
case 2: menuClick();getOption(dif,menuMsg);break;
case 3: exit(1);
}


menuClick() just plays a little click sound.

And yes, I created drawMenu.h, took me 6 hours :S, i like it because i use it for any college programs.

The following user thanked TheUberFail for this useful post:

El Violador
01-31-2011, 03:01 AM #6
El Violador
< ^ > < ^ >
Originally posted by TheUberFail View Post
I must admit, the programming was really not efficient, when i coded it i was on a fast computer so i dident notice :( but now im on my home PC, it lags a bit. But anyway, it works :P.

You can easly create a menu system like you see in this program, the drawMenu.h header file is in the source code, at the start of your C++ program, write

    #include "drawMenu.h"


Make sure to have drawMenu.h in the same folder as your program you are writting.

Syntax: drawMenu("Message to ask","Options|Sperated|Like|This",1);

The last number is how many tabs you want to to tab across the screen. 0, means the message to ask is at the far left of the console, and the menu items are always 1 tab from the left to the message to ask.

Heres the how i created the menu system for the ping pong

    switch(drawMenu(menuMsg,"Play|Select Difficulty|Exit",1))
{
case 1: menuClick();handel(dif);break;
case 2: menuClick();getOption(dif,menuMsg);break;
case 3: exit(1);
}


menuClick() just plays a little click sound.

And yes, I created drawMenu.h, took me 6 hours :S, i like it because i use it for any college programs.


thanks man ill need to use this Happy
except im not that good at c++ lol
01-31-2011, 12:26 PM #7
Dr.Fox
Foxeh =D
I played it . Gets very boring . But very very cool coding dude . Nice !

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo