Thread: Another game i made

  1. #1
    I'm Back
    Join Date
    Dec 2001
    Posts
    556

    Another game i made

    Here's another game i made in c++.

    controls are
    left-right arrow keys to move
    enter to fire
    esc to exit in between

    Tell me how do you like it.
    Last edited by ihsir; 12-22-2001 at 01:18 AM.

  2. #2
    Registered User slick1537's Avatar
    Join Date
    Dec 2001
    Posts
    9
    Its is very different I will say, not something you could sit around and play for hours, but different. I must say I dislike how you have the computer make noice instead of say, a sound file.

  3. #3
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    seems nice

    cool, i think i will try to do something similar. is the whole screen an array, a big one or something? was it a lot harder than making tic tac toe? could you maybe post the code so i can learn from it?

  4. #4
    Interesting code. Post the source!
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  5. #5
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    i'll help you all with the game logic, coding, steps etc etc, but don't ask for the source. people usually just take the code and insert a line displaying their name as the orignal author and showoff which is what i hate. i have seen guys do that and get away which is bad.

    like i said earlier you want to know how to go about it feel free to ask me and i'll help as much as i can but you have to spend some time on the computer to do the coding yourself rather than do cut-copy-paste.

  6. #6
    Something Clever ginoitalo's Avatar
    Join Date
    Dec 2001
    Posts
    187
    Most Excellent !

    So is the screen a big array or did you use the gotoxy(); ?

    How did you make the border -
    with underscores and pipes or
    something special ?

    Thanks
    - -

  7. #7
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    well first of all the screen isnt a big array or any thing its just a screen!!

    to put the faces i used random in stdlib.h to get a column number and gotoxy to put it.
    i put all the colums in an array to see that there is no overlap of cols and the faces are equal to the number wanted by the player

    for(i=0;i<tot;i++)
    col[i]=random(80);
    for(i=0;i<tot;i++)
    {
    gotoxy(col[i],3);
    cout<<"";
    }

    i have used ascii codes for the lines (if you want a program that gives the ascii code and bioskey() code you can download it from my site)

    whenever the player hit enter i used for loop
    for(row=22;row>=3;row--)
    {
    cout<<"!";
    delay(20);
    cout<<" ";
    }

    if the present column number is same as any one in the col array then it means the player has hit the target and gets a point else no point.

    i hope this helps..

  8. #8
    Something Clever ginoitalo's Avatar
    Join Date
    Dec 2001
    Posts
    187
    Yup, good stuff but why not use <conio.h> 's getch()
    instead of the <bios.h> 's functions ?

  9. #9
    Registered User
    Join Date
    Aug 2001
    Posts
    129
    Interesting... How about making it move while the arrow flies?

    > but don't ask for the source. people usually just take the code and insert a line displaying their name as the orignal author and showoff which is what i hate. i have seen guys do that and get away which is bad.

    I can't see what's so bad about this. Of course I agree that it's ethically wrong to lie (in this case), but in programs like this does it really matter? After all, I believe that those who ask the source would rather learn from it than abuse it.

    ``And thou shall kneel in front of a man who shall reveal the dark mysteries of The Source ''

  10. #10
    Registered User JTtheCPPgod's Avatar
    Join Date
    Dec 2001
    Posts
    44

    Sound?

    Hey ihsir, I'm just curious but how do you do the internal speaker beeps? I remember how to do this in VB but my friends and I could never figure out the beep code in VC++

  11. #11
    Unregistered
    Guest
    Good Question,

    How would you make the cursor/character move while the missle shoots (while in the for loop) ?

  12. #12
    I'm Back
    Join Date
    Dec 2001
    Posts
    556

    sorry for the late replies

    ginoitalo :
    ********
    i thjink bioskey() function is better than the getch while using inputs like arrow keys also i'm not sure wether getch accepts them.

    kooma :
    *******
    you could code in the following way

    for(row=22;row>=3;row--)
    {
    //to fire the missile
    gotoxy(col,row);
    cout<<"!";
    //to move the character
    gotoxy(c,r)
    cout<<" ";
    delay(10);
    //clean-up
    gotoxy(c,r)
    cout<<" ";
    c=c+1;
    r=r+1;
    }

    I haven't tested this. just writing out the basic you can modify.

    on the source code thing you are right about people studying it rather than abuse and also it aint such a great prog to go about hiding the code but then i'm helping you aren't i...

    JTtheCPPgod :
    ************

    sound(int value);
    this command turns the pc speaker on at the given fraquency

    nosound();
    will stop it.

    Eg
    sound(10); //10Hz sound
    dealy(1000); [or] sleep(1); // one sec delay
    nosound();

    i haven't programmed in vc++ in a great deal, i have used turbo c++ ver3 so can't say much about it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Oh shnap, i made a game
    By s3abass in forum C++ Programming
    Replies: 15
    Last Post: 05-11-2009, 10:33 AM
  2. 20q game problems
    By Nexus-ZERO in forum C Programming
    Replies: 24
    Last Post: 12-17-2008, 05:48 PM
  3. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  4. Game Programmer's AIM Circle: Join Today
    By KingZoolerius66 in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 12-20-2003, 12:12 PM
  5. Someone help me with this game??
    By stehigs321 in forum Game Programming
    Replies: 15
    Last Post: 10-30-2003, 09:42 PM