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.
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.
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.
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?
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
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.
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
- -
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..
Yup, good stuff but why not use <conio.h> 's getch()
instead of the <bios.h> 's functions ?
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 ''
kooma - [email protected]
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++
Good Question,
How would you make the cursor/character move while the missle shoots (while in the for loop) ?
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