Game analysis
E N D
Presentation Transcript
Game analysis Don’t get angry
Subject • What is the game about? • Looking into the algorithm • Looking into the code • Complexity and conclusions
What is the game about? • Board game • 2-4 players and requires a dice • Objective of the game?
Looking into the algorithm • We divided the algorithm into 4 parts • Game configuration • Lojtar Ushtar • Game control panel • Graphics
Game configuration • index = f(key, array_size) We create a hash map with keys name of the colors and the value of the colors. Complexity of the creation of this hash is O(n).
Game configuration • We have created functions that get the colors and the coordinates of the boxes. • These functions are trivial and don’t effect the complexity.
Lojtar • We initialize an array named Ushtaret with 4 elements. for(inti=0; i<4; i++){ ushtaret [i]=new Ushtar(GameConfig.getInstance().getColor(index),index); • We also create a function to see if a player has soldiers in the game: for(inti=0; i<4; i++){ if (ushtaret[i].isSelectable() && ushtaret[i].getIndex()>=0) return true;
Lojtar • In this file we also have the functions to get the number of soldiers • Set and get the goals and increase the goals
Ushtar • The main functions are the ones that set and get the index value of the soldier position • Also it has some functions which don’t effect the complexity such as creating the soldier form and color
Game control panel • This file has the functions that create the main game panel which contains the buttons, labels etc. • This is the part where the dice roll is created
Graphics • The graphics is divided in separate files which interact with each other. • Creates the main board where the game takes place
Thank You Julian Caushaj