JIRA - Introduction
We use Jira for project management which allows several Scrum-functionalities.
Our sprints last for one week each in order to fit the weekly updates on our blog and the given tasks of the lectures.
Because of initial difficulties, we had some problems using Jira in order to get a fancy burndown-chart. The burndown-chart of week 2 is displayed on the right. Because Jira does not support the public chart-generation, there is no public access to live diagrams available.
Jira Integration in Android Studio (IDE)
GIT integration in Jira
Game Engine - General
When we talk about the "Game Engine" we focus on the inner core of our app which is doing the logical part. This engine provides our objects at the moment without a physical extension. That will change in the next weeks, but the behavior of our main objects like towers and enemies will still be the same. To get an overview of the development just have a look at our class setup:
At the top, you can see some testing classes for JUnit. Actually we only test the logic of the classes Enemy and Tower, because of the artificial intelligence they include.
As we described it in our process we handle two Activities currently, the MainActivity which is the starting page with a menu and the GameActivity where the game is running at.
The 'Game' class creates a simple demo of our game which is helpful for us to see if everything is working as we expect.
Game Engine - "MatchField"
The first part of the engine is the class "MatchField". This class keeps all the enemies and towers and controls them. The main part is about moving the enemies and let the towers shoot them. So every Object needs a different thread to be able to act independently on the map. An example of starting the towers looks like that:
- As long as there are enemies on the map our towers will be able to fire
- after one shoot we clear the map by removing dead enemies
- if there are no enemies left on the map, the towers will be stopped (the map contains all enemies of a wave even if they are not spawned yet)
- the timer task we used there, also have to observe the fire rate of a tower
This class "MatchField" is, in conclusion, our game controller, so it also knows when the game is over and so on.
Game Engine - Enemy & Tower
The abstract class Enemy contains all basic actions an enemy has to perform. So it contains the logic to move on the given path the ‚MapStructure‘ defines and it also knows about the healthpoints, moving speed and other criteria. The move action can move the enemy one pixel on the given path, the enemy class makes sure that it’s moving in the right direction. But the move action is called by the MatchField to control the speed by scheduling a timer.
More interesting is the artificial intelligence of ower towers. Before a shoot, we need to calculate for every enemy which already spawned on the map the distance to our tower. Then we need to decide if the enemy is in the shooting range. If there are multiple enemies in range we focus on the nearest. In most tower defense games the focus only changes when the enemy is out of range, so towers fire multiple times on one enemy. The logic is not hard to implement but we are not quite sure if we want this behavior or not. So maybe you can give a feedback about which behavior you would expect. Currently, a tower focuses on the nearest enemy and calculates that before every shoot. The distance for all enemies is collected in a map, where we wrote our own util to sort the map by value. So we have the possibility to get the next enemy to the nearest if the first one was shoot at the same time and is already dead… So you see there is lot we had to think about.
Game Engine - "MapStructure"
Another big part is our MapStructure. We need to create a map with lots of fields. Every field has one of the conditions: free, path or tower. So a tower can only be placed on a free field, but then the field is set to tower. A field can also be free again by deleting a tower. But the path can not be changed while the game is running. At the moment we set a fixed path by defining different positions at the beginning, where the fields should be a part of the path. But the map Structure does also include more logic. It is the representation of the map and has methods like getNextFieldForEnemyToMove() and so on.
Creating a random path will be very easy, with the foundation we have here. But in the beginning, we won’t focus on that.
We don’t want to bore you with some more detailed information yet. There is some more stuff like the Bullet class which represents the projectiles a tower can shoot, but enough is enough.
Game Engine - Application
The current result of our game-engine is only textbased in the console. We saw that before in week 4 as a preview, now you know a bit more how it works. The game is already running like intended. So enemies move, towers shoot and also the game stops if all enemies passed the target or died before.
Next step will be to visualize our objects and just to give you a little preview, yes we are already working on that! 🙂