HI welcome

Hi every body I am here to tell you that fell free to talk about the cames you make in c++ and help others with making there oun thank you.

Comments

  • : Hi every body I am here to tell you that fell free to talk about the cames you make in c++ and help others with making there oun thank you.
    :

    Yo I'm another wee programmer dude out there wanting to know how to program games in c++. Got any tips?

  • : : Hi every body I am here to tell you that fell free to talk about the cames you make in c++ and help others with making there oun thank you.
    : :
    :
    : Yo I'm another wee programmer dude out there wanting to know how to program games in c++. Got any tips?

    how? easy:

    #include
    #include
    #include
    #include
    #include
    #include
    #include
    typedef struct tikke{
    int x,y;
    struct tikke *next;
    }tikke;

    tikke *start,*check;
    int tt;

    class toop{
    public:
    int rx,ry,sign;
    float punkt;
    toop(){
    sign=1;
    punkt=0;
    rx=50;
    ry=12;
    gotoxy(rx+6,ry+6);
    cout<<"*";
    }

    void rtoop(){
    randomize();
    rx=rand() % 68;
    ry=rand() % 15;
    /* check=start;
    for(int i=1;i<tt-2;i++){
    if((rx+6)==check->x && (ry+6)==check->y)
    rtoop();
    check=check->next;
    } */
    gotoxy(rx+6,ry+6);
    cout<<"*";
    punkt+=10;
    sign=-sign;
    }
    };


    class mar:private toop{
    int i;
    tikke *rec;
    public:
    mar(){
    start=new tikke[1];
    start->x=1;
    start->y=12;
    rec=start;
    gotoxy(rec->x,rec->y);
    cout<<"";
    for(i=2;i<11;i++){
    rec->next=new tikke[1];
    rec->next->x=i;
    rec->next->y=12;
    gotoxy(rec->next->x,rec->next->y);
    cout<<"";
    rec=rec->next;
    }
    tt=10;

    }

    void moving(char ch){
    if(sign==1){
    rec=start;
    gotoxy(rec->x,rec->y);
    cout<<" ";

    for(i=tt-1;i!=0;i--){
    rec->x=rec->next->x;
    rec->y=rec->next->y;
    rec=rec->next;
    }
    }

    if(sign==-1){
    rec->next=new tikke[1];
    rec->next->x=rec->x;
    rec->next->y=rec->y;
    sign=1;
    tt++;
    }

    switch (ch){
    case 'M':
    rec->x++;
    break;
    case 'K':
    rec->x--;
    break;
    case 'H':
    rec->y--;
    break;
    case 'P':
    rec->y++;
    break;
    default:{
    _setcursortype(_NORMALCURSOR);
    exit(0);
    }
    }



    checking();
    gotoxy(rec->x,rec->y);
    cout<<"";
    }
    void checking(){
    check=start;
    for(i=1;i<tt-2;i++){
    if(check->x==rec->x && check->y==rec->y){
    _setcursortype(_NORMALCURSOR);
    sound(600);
    delay(320);
    nosound();
    gotoxy(30,1);
    cout << "**** Game Over ****
    ";
    cout << punkt;
    delay(3000);
    exit(1);
    }
    check=check->next;
    }
    if(rec->x==75 || rec->y==22 || rec->x==5 || rec->y==3){
    _setcursortype(_NORMALCURSOR);
    sound(600);
    delay(320);
    nosound();
    gotoxy(30,1);
    cout << "**** Game Over ****
    ";
    cout << punkt;
    delay(2000);
    exit(1);
    }
    if(rec->x==rx+6 && rec->y==ry+6){
    sound(1100);
    delay(10);
    nosound();
    rtoop();
    }
    }
    };
    void hashie(){
    int i=5,j=3;
    for(j=3;j<23;j++){
    gotoxy(i,j);
    cout << "";
    i=75;
    gotoxy(i,j);
    cout << "";
    i=5;
    }
    j=3;
    for(i=6;i<75;i++){
    gotoxy(i,j);
    cout << "";
    j=22;
    gotoxy(i,j);
    cout << "";
    j=3;
    }
    }

    void main(){
    clrscr();
    fflush(stdin);
    hashie();
    toop too;
    mar badan;
    char cht,ch='M';
    _setcursortype(_NOCURSOR);

    te:

    for(;;){
    while(!kbhit()){
    delay(50);
    badan.moving(ch);
    }

    ch=getch();
    ch=getch();
    if(ch==cht){
    if(cht=='M')
    ch='K';
    if(cht=='K')
    ch='M';
    if(cht=='P')
    ch='H';
    if(cht=='H')
    ch='P';
    goto te;
    }
    if(ch=='M')
    cht='K';
    if(ch=='K')
    cht='M';
    if(ch=='P')
    cht='H';
    if(ch=='H')
    cht='P';

    }

    }
  • : : Hi every body I am here to tell you that fell free to talk about the cames you make in c++ and help others with making there oun thank you.
    : :
    :
    : Yo I'm another wee programmer dude out there wanting to know how to program games in c++. Got any tips?
    :
    :

    Have you tried out the Allegro Game Programming Library?
    "http://www.talula.demon.co.uk/allegro/" There you'll find both the library and tutorials for it. I highly recommend using DJGPP for this library but I think you can use it with Borland as well.
  • : : : Hi every body I am here to tell you that fell free to talk about the cames you make in c++ and help others with making there oun thank you.
    : : :
    : :
    : : Yo I'm another wee programmer dude out there wanting to know how to program games in c++. Got any tips?
    : :
    : :
    :
    : Have you tried out the Allegro Game Programming Library?
    : "http://www.talula.demon.co.uk/allegro/" There you'll find both the library and tutorials for it. I highly recommend using DJGPP for this library but I think you can use it with Borland as well.
    :
    I am waiting for someone to the level design and artwork ,so
    a game project can be started .... Any Volunteers ????
    Karthik Kumar V

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories