Link to home
Start Free TrialLog in
Avatar of Bryeguy2012
Bryeguy2012

asked on

In desperate need of help

Im using Dev c++ ( instructors requirements) here are the requirements and the code i have so far : This code does not compile at the moment and I can't seem to figure ouot how to do the rest. This project is due Feb 12 2012 please respond to <email deleted - see admin comment> with suggestions. Here are the requirements: THJIS is to be a console application: the screen size 23,80 which is in the attached code (I think it's correct but highly doubt it at the same time).
Criteria
- The game loop runs with proficiency through the correct sequence of events.
- The game loop runs when a key is not pressed.
- A valid direction enumerator exists.
- Distinct characters have been selected for each player.
- The code shows the capacity for multiple players.
-A routine for collision has been set up between players.
-The code prevents back tracing on human players.
-The code of the final Tron game is functional.
-The computer player makes turns.
-The human player plays correctly.
-At least one bonus feature is added.
-Players can play more than once.
-The game initializes correctly at the beginning and end. Code is attached
Trontxt.txt
Avatar of Hugh McCurdy
Hugh McCurdy
Flag of United States of America image

Unfortunately, I'm coming from Linux and don't have DevC++ installed.  Some free advice (no points please for this).

Line 46 should end with ";

I'm not able to compile the program in Linux because conio.h isn't portable.  I'd suggest you use a curses type library but you are really short on time.

Finally, I strongly suggest you ask a question instead of just posting the program and your needs.  Better chance of getting help.
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I suggest you do what SaraBande said.  She gave you a good start.  (I also suggest you give her the points).

If you need help, once you get restarted, please make a new post and ask a narrow question.
Avatar of Bryeguy2012
Bryeguy2012

ASKER

I did just that Thanks for the restart Sara !
I am obviously a (perhaps) less than novice shall we say,
another question I have is in this code where do I properly but classes and function for example:

Player player1;                <-- put classes above this line
      Player player2;      <-- you would suggest put  funtion(s) after this line OR
      Game game;
      game.init(&player1, &player2);
      game.play();                  
      return 0;

 ETC . I am hoping It may direct me a bit further. THANK YOU B.!!!
class definition would be in a header file (which then is included in the cpp file at top) or - for simplicity - below include statements and above all other code.

if one class needs another class as member (in the sample Game would need Player) you would need to order the classes properly, that means class Player was above Game - or if using header files: game.h would include player.h but not other way round.

in my sample code i passed player1 and player2 by pointer to init member function of Game (see the & before the argument). that would mean the class  Game is defined like

class Player
{
    ...
};

class Game
{
      Player * pPlayer1;
      Player * pPlayer2;
public: 
      Game();
      void init(Player * player1, Player * player2);
      ...
};

Open in new window



the implementation of the member function would be in player.cpp and game.cpp or directly below both class definitions.

Sara