[Implementation]+[Maintenance] Elefant Hunt

Screenshot of Elefant Hunt Computer Game

Screenshot of Elefant Hunt Computer Game

Unlike usual, I won’t bother explaining the GUI classes that I used because it’s redundant and repetitive (Check the previous posts to learn GUI stuff!).

Check https://gygd.wordpress.com/downloads/ to download the game.

This page will be kept updated for further changes on the software.

—————————————-First Update: July 5th————————————–

Screenshot of Elefant Hunt Computer Game

Screenshot of Elefant Hunt Computer Game

  • The content of Log changed a lot to give more accurate and organized information to players.
  • “Current Player: Name” label and “Start Turn” button are added.
  • A critical error occurred after playing too many turns was fixed.
Advertisements

[Implementation] Elefant Hunt – Player, ElefantHunt

There are two more classes that act as Engine: Player and ElefantHunt.

‘Player class’ is a blue print that represents a player. So it contains each and every attribute that normal player would have. For example, there are points (score obtained), position (position on the map), supplies (something to feed the hired hunters), name, and capturedAnimals (ArrayList that contains a list of Animal objects). Other than its attributes, it also contains behaviors (methods) necessary to control those attributes.

‘ElefantHunt class’ manages the whole flow of the game. It’s a place where every class meets together and cooperate. It has GUI related objects, information on map, information on players playing the game, # of supplies existing on the port and information on Hunter and Animals. As there are a number of attributes and behaviors in this class, I recommend you to check the source codes distributed with the game if interested.

[Implementation] Elefant Hunt – Animals, Hunters

Image of the board game "Elefant Hunt"

Image of the board game "Elefant Hunt"

According to the description of Wikipedia (http://en.wikipedia.org/wiki/Tom_Wham), “Elefant Hunt” is a board game in which great White Hunters travel through deepest, darkest “Aferca” with the help of natives to capture as much live animals and ivory as they can to sell for profit.

It’s right: the main characters of this game are Animals and Hunters! Then, I decided to create two classes that represent Animal and Hunter.

But, wait a second… aren’t they similar? Both Animal and Hunter cards of the board game have level and name. So, why don’t I just make a class that represents the common part of both classes to do less work? It’s why I created Item class that has attributes of level and name. By inheriting the Item class, it was handy to create Animal and Hunter classes.

I will end this article with the UML diagrams. As stated, Hunter and Animal is sub-classes of Item. Check the source codes attached on the download section to see details.

Item UML

Attributes Behaviours
int level Item(int lvl, String newName)
String name int getLevel() // gets the level of hunter and animal
String getName() // gets the name of hunter and animal
String toString() // return String representation

Animal UML

Attributes Behaviours
boolean isPredator

//is a predator animal? or a friendly animal?

Animal (int lvl, String name, boolean predator)
boolean isPredator()
String toString() //return String representation

Hunter UML

Attributes Behaviours
boolean isMain

//is your main hunter? or other regular hunter?

Hunter(int lvl, String name, boolean isMain)
boolean isMain()
String toString() //  return String representation

Animal UML


[Requirement] ElefantHunt

Hello, I am software developer Wonjohn Choi.

The software that I will develop now is called “Elefant Hunt.”

This old board game is nine years older than I and I first played this in Grade 12 computer science class that I took in my school (St. Francis Xavier Secondary School). As the final project, my team in the class had to develop a computer game based on this board game, but unfortunately, due to time restriction, we could not finish.

Now I want to develop this game fully from the beginning as I have enough time in this summer.

    Here is the specific information.
    • Requirement: Develop “Elefant Hunt” software with fully-functional Graphical User Interface based on the board game “Elefant Hunt.”