Thread: New Game

  1. #1
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200

    New Game

    I need some suggestions from some of you people.

    What would be a good first game using graphics?
    I just figured out how to use graphics.h and I need some info on a project that would be simple for a first!
    What is C++?

  2. #2
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    I just thought of a new game, it could be two player, or one against the AI. There is a runner and a catcher. Both players control circle, the runner circle is smaller that the catcher. If you are the runner, you are suppose to avoid the catcher for a certain time. If you are the catcher you are suppose to catch the runner. By catch, it means touch them. It looks better in my head than it sounds .

  3. #3
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    If you want to get some graphics experience without worrying about having to conquer anything too new, I'd say take a game you've already written in console and make a graphical version of it. Like say a graphical tic-tac-toe or hangman.

    If you want something totally fresh, then maybe make a side-scrolling shooter or top-down shooter. And of course there's always everyone's (? maybe) first graphical game, Pong.

  4. #4
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Chokes and spits out drink when sees pong...

    PONG!?!?!

    No thank you.. no bounce and angles and crap

    I have a problem though... how do I use graphics with arrays?

    Is there any good examples of programs
    What is C++?

  5. #5
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    I'm not familiar with the graphics.h file you mentioned but here's a generic example of using arrays with graphics:

    Code:
    CEnemy cdBadGuys[3];
    CHero chYou;
    int i;
    
    MainDrawingLoop()
    {  
       for(i=0;i<3;i++)
       {
          if(cdBadGuys[i].IsAlive())
          {
             cdBadGuys[i].DrawBaddy(cdBadGuys[i].MapX(),cdBadGuys[i].MapY);
          }
       }
       chYou.DrawHero(chYou.MapX,chYou.MapY);
    }
    Not sure if that's what you're looking for or not. If you could post a generic blit routine that you might you use, I can offer more specific help.

    Jason

  6. #6
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I really just want to know how to draw.. say a circle and move the circle across the screen.

    And is it dificult to use images?

    Im not sure how I would make a ship in a shooter?
    What is C++?

  7. #7
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    What compiler are you using? Did graphics.h come with it or is it something you downloaded from somewhere else? This is the first I've heard of it so I'm not sure if it's a stand-alone library or a wrapper for another. If I can find out what API/library it's using then I can look into it and give you a better answer.

  8. #8
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Borland C++ 5.02

    Its BGI graphics.

    Code:
    #include <iostream.h>
    #include <graphics.h>
    
    int GraphicsDriver;
    int GraphicsMode;
    
    int gridx [50];
    int gridy [50];
    
    int main()
    {
    	initgraph ( &GraphicsDriver, &GraphicsMode, "c:\\bc5\\bgi" );
    
       setcolor (RED);
       outtext ("So sue me.. ");
    
       setcolor (YELLOW);
    
       setfillstyle ( SOLID_FILL, YELLOW );
    
       pieslice ( 100, 100, 30, 330, 15 );
    
       setcolor (WHITE);
       setfillstyle ( SOLID_FILL, WHITE );
       pieslice ( 140, 100, 1, 360, 2 );
       pieslice ( 160, 100, 1, 360, 2 );
       pieslice ( 180, 100, 1, 360, 5 );
    
    
       cin.get();
       closegraph();
       return 0;
    }
    cant get any farther...
    What is C++?

  9. #9
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    You finally figured that thing out huh? That's some funky old DOS library J Why don't you give tetris a try Vicious? You'd get to learn basic collision among cool stuff.
    "The mind, like a parachute, only functions when open."

  10. #10
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I would but all I know how to do is put out the graphics...

    I cant make it move or get key input and move the pieces or whatever.

    What is C++?

  11. #11
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    oh and if anybody knows this...

    How do you make a tetris block?

    What is C++?

  12. #12
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    Whoa... I think you're going to need to learn how to get keyboard input if you're going to make a game there buddy

    Tetris blocks? Think about it... every block is made up of four smaller blocks.

    You could either code some rectangles, or use bitmaps.

    I'm about to start working on a tetris game myself. I've put it off way too long. I just can't decide which library to use. No, I don't think I'll use BGI
    "The mind, like a parachute, only functions when open."

  13. #13
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Code:
    #include <iostream.h>
    #include <graphics.h>
    #include <conio.h>
    
    int GraphicsDriver;
    int GraphicsMode;
    
    int x = 25;
    int y = 25;
    int quit = 0;
    int mve;
    
    
    int main()
    {
      initgraph ( &GraphicsDriver, &GraphicsMode, "c:\\bc5\\bgi" );
    
      while ( !quit )
      {
          gotoxy(1,1);
      		cout << "X: " << x << "  Y: " << y;
    
          mve = getch();
    
          switch ( mve )
          {
          	case 'w':   y--; break;
             case 's':   y++; break;
             case 'd':   x++; break;
             case 'a':   x--; break;
             case 'q': quit=1; break;
          }
          	cleardevice();
             circle ( x, y, 10 );
       }
    closegraph();
    return 0;
    }
    Thanx again Lamb.
    Last edited by Vicious; 05-29-2002 at 11:52 PM.
    What is C++?

  14. #14
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    OOOPS!

    Forgot to post my question.

    How can I make it move faster??
    What is C++?

  15. #15
    Registered User Invincible's Avatar
    Join Date
    Feb 2002
    Posts
    210
    "The mind, like a parachute, only functions when open."

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