View Single Post
Old 05-01-2005, 06:59 PM   #84
Kon-Tiki
[BANNED]

 
Join Date: Sep 2004
Location: Dentergem, Belgium
Posts: 1,811
Default

Although we're making it in C++, I've been working on it in Java, just for practice (as I do need practice in Java for school). Results up till now can be found here. Comments're in Dutch, along with some variable names, but it shouldn't be hard to figure out What's done up till now:
  • Drawing a basic playfield
  • Moving a selector over the playfield
  • A class for the units
  • A class for the buildings
The playfield is made up from a double array object. The double array's indexes are the x- and y-coordinates. The object itself contains information 'bout what is on it.

The selecting uses two classes: one for input, one for checking and changing the unselected pic to the selected one. This changing's done with a few switch-commands. For now, it might look useless that it has only one case in some switches, but the more unit- or building-types will be added, the more cases will come, so I wanted to have it right from the first time.

The units-class has five variables: one for HP, one for defence, one for attack, one for movement points and one for the time it takes until this type of unit is recruited. This last one needs to be passed on to the building that's recruiting.

The building-class has four variables: HP, defence, recruiting time and recruited type. Recruiting time is 0 in standard, meaning that nothing's being recruited. The recruited type is to know which type of the object Unit to make once the recruiting time comes to 0.

To do
  • Creating types of the unit- and building objects.
  • Getting the selector to select and allow choices
  • Moving units
  • Attacking/Defending + destroying
  • Turn-switching
  • End game checking
Kon-Tiki is offline                         Send a private message to Kon-Tiki
Reply With Quote