Thread: C++ Game

  1. #31
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Nice

  2. #32
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    thank you, thank you, thank you very much ^_^
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  3. #33
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Why d'you need that timer anyway?

  4. #34
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    Its just so that it can go up until you press a key, instead of pausing the program and waiting for input
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  5. #35
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    What are you making with the timer?

  6. #36
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    But give us the code

  7. #37
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    It's something like:
    Code:
    #include <stdio.h>
    #include <conio.h>
    #include <stdlib.h>
    
    int main(int argc, char *argv[])
    {
     int microcounter = 0; 
     int counter = 0;
     int x; 
     while(!kbhit()) 
     {                     
       microcounter += 10;  
       if(microcounter == 1000)
       {
        counter++;
        clrscr();
        printf("%d",counter);
        microcounter = 0;
       }
       sleep(10); 
     }
     return 0;
    }
    Last edited by Brian; 02-23-2002 at 11:55 PM.

  8. #38
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Thank yoo.. I will try implementing it.. It would be great if some one could modify my source to stop the freezing stuff and post it here. So that we can get a better idea.

  9. #39
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    I don't have BGI on my compiler.

  10. #40
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    got 1 more doubt

    Well i have got another doubt.. THe misile cursor keeps moving from left to right in the bottom screen. Instead of that i want that to be positioned in the middle and only the angle of the cursor should change while shooting. I tried doint this. I kept the value of x and y axis of the bottom point of the cursor a constant. but i could not generate values for x and y for the above point of the cursor so that when it move the cursor make a perfect arc. ANy idea...

  11. #41
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    You mean so it rotates instead of sliding?

    I've been trying to do that with one of my games, I'm not sure how yet, but it's more complicated than it seems.

  12. #42
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Ok i want the cursor to move in an circll. With one of it's end fixed.. How do i do it..

  13. #43
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Thats matthy and complicated.

    I'm still trying to figure it myself.

  14. #44
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Ok i got it but what is the HEX value for the up and down arrow key.. I have the hex value only for left and right

  15. #45
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    to find out, do this:

    Code:
    #include <stdio.h>
    #include <conio.h>
    
    int main(void)
    {
     int i;
     while(i != 'q')
     {
      i = getch();
      printf("\n%d",i);
     }
     return 0;
    }
    run it, and press any key and it's ascii code will show up on screen.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. Open Source / Semi Open source game idea. Help needed
    By CaptainPatent in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 05-16-2007, 10:44 AM
  3. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  4. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM