djog / tank_battalion Goto Github PK
View Code? Open in Web Editor NEWTank Battalion recreation by DJOG Uno's 2020 in processing.
License: GNU General Public License v3.0
Tank Battalion recreation by DJOG Uno's 2020 in processing.
License: GNU General Public License v3.0
Currently the gird consists just of some randomly generated nodes. To create & load levels the grid needs to be able to be loaded from a text file.
Create a testing level file in the folder call & place it it in: assets/levels/maze.ini
Every line of the file should correspond to one row in the grid.
A number indicates what kind of node the text represents.
For now the file should be read in the constructor of the grid class.
Draw the tank in the center of the screen
Create 2 functions
If an enemy get's hit by a player's shell, it should die.
- [ ] Create a variable (for example boolean shot_by_player
) to know the difference between a shell shot by a player and one by an enemy
shot_by_player = true
)is_dead
to true- [ ] Remove the enemy (Don't forget it's collider) from the game
Currently, enemies spawn on a random x position in the grid on the top layer. This x position can be inside a brick.
This shouldn't be possible.
When spawning an enemy, check if the enemy collides with a brick. If it does, give it a new x value, and check again. Do this until it doesn't collide anymore. (Use a loop for this)
Currently the players & enemies can't fire yet. To make them able to fire we need a Shell class wich represents the shells the tanks are able to fire.
According to the wiki the score you gain from killing an enemy is random between 30 and 1600 (Although it looks like it's only round numbers, maybe the person doing this issue could further investigate how exactly the score is determined?)
This score is currently added to the total score but there should be a short pop up showing how much points you gained in the place where the enemy got destroyed. Add this
Currently the player & enemies don't collide witch each other. To implement this in a good way that also fits the collision detection for the shells I thinks we need to create a hashmap system I used in the Physics system last year.
Create a global hashmap variable in collision detection tab called colliders that stores the players & enemies by id and AABB.
If a player or enemy gets updated the corresponding AABB should be updated as well.
PS: If you know a better approach please let me now. If used this system before and out of experience i know it just works.
#42 is finished, the player is able to fire.
Now make sure the enemies can fire back too!
fire_timer
/fire_delay
just like the rotate_timer
/rotate_delay
@richelbilderbeek We need the original game sounds. @richelbilderbeek promised to do this before next week.
Currently the high score is rendered by code you wrote. Great job!
Instead of placing that code in the draw() method I think it deserves a method. I think that makes the code a bit more readable?
Every round of the game enemies gets spawned after some amount of time.
Create a countdown timer system that counts down a few seconds. The amount of time should be random between two constants. When the timer goes of an enemy should be spawned at the top of the arena. Note that the enemies shouldn't move yet. We will implement that later.
Update the physics system to add support for layers with bitmasks.
Currently we have a shell class that doesn't do anything yet.
Implement the shell class, the player tank should fire:
ArrayList<Shell>
called shells
in the GameState
update()
on the shell classKeep the implementation as simple as possible we will add more advanced combat features later
Create a grid class that has a two dimensional array of unsigned integers that indicate what type of nodes they are. For now 0 is just nothing and 1 is a brick node. The class should also have a draw function that draws the grid.
In the main class the grid should just be created & the draw function should be called.
Create a new class in a separate file called Player
The class should contain the following things:
Dutch GitHub help: djog.github.io/help
Unassign yourself if you're done.
As a precaution I will not be present next Thursday. Currently I am in Greece where part of the country is marked code orange. The part In am visiting is still code yellow, but I'd rather be safe than sorry. I will be back on september 24.
Improve enemy movement by adding a delay between rotation.
Currently we have two types of enemy thank: normal & rainbow. But there are more types than just normal and rainbow. To represent multiple types we need a tank type:
TankType
. It should have 3 values: NORMAL
, RAINBOW
& RED
.is_rainbow
variable in the enemy class and the argument in the constructor with the enemy type.Create an Enemy class with the following things:
Then implement the class by doing the following things:
The shell class is added, now a tank (so both players and enemies) has to be able to fire. This should be done with the spacebar for the player.
If there is such a collision, the brick(s) hit should be removed from the grid.
Create a new class called Flag that contains the following things:
An x & y position variable - assigned in the constructor
A draw function that draws the flag sprite at the position of the flag
Create an AudioManager that loads sound files when they are played for the first time.
You shouldn't add sounds yet. Just add some testing sounds to test if it works and remove them afterwards.
Currently the player & the enemies can't die yet.
Add a health system so that the tanks can take damage and eventually die:
health
on the player/enemy classesis_dead
to the player/enemy classestake_damage(int damage)
to the player/enemy classes. The damage should be subtracted from the tanks health. If the health is equal to or below zero is_dead
should be set to trueSometimes, a random rainbow tank might spawn in the game. I don't know the exact odds, but they are rare.
This is it for now, we will later add the feature were the player gets a superpower if they destroy the rainbow tank.
Search in the internet to find a maze generation algorithm that we can use in our tank battalion game.
As you can see here, there are different layouts for each round.
Once #46 is done, you can create a system to load the different layout for each round.
Add placeholders
grid
class, add a new string variable called layout_file
, which holds the name of the layout file to load.on_new_round()
in the game_state
filegrid = new Grid("layout-x");
), reposition the player to its starting position again and empty the enemy ArrayListI think this should do the job, but maybe @Rijk-van-Putten has a better or cleaner idea of how to do this. - Yes I have (partly)
In the screenshot below, the player has two lives left:
n_lives
[
to decrease the number of lives, if there is more then one life left]
to increase the number of lives, if there is less then three livesDepends on #12
According to https://strategywiki.org/wiki/Tank_Battalion the game has a grid of 26 x 26. @robkruger added a system of representing one tile with 4 subtiles. So that means the arena should consist of 52 by 52 tiles.
But currently the arena size is set to 44 x 46.
So maybe @Dreojs-NL can resize the levels to 52x52? In his issue: #46
I have 2 tests tomorrow and still have to study.
(I added the dependency label because it's better to do this after #56, or the other way around, because they're quite similar)
If the player get's hit by an enemy, it should die and the round should be restarted.
Add a proper menu screen instead of the boring placeholder right now.
The explosion sprites/animation are missing.
Find a way to add them to the project.
As you can see here, there are 8 different layouts the map can have.
Currently we only have 1 layout.
To create a new layout, create a new .ini file called layout-x.ini
You can look in the file layout-1.ini how to create one.
0
means that there is no brick in that position1
means that there is a topleft-brick section in that position2
means that there is a topright-brick section in that position3
means that there is a bottomleft-brick section in that position4
means that there is a bottomright-brick section in that positionCurrently we handle everything in the setup() and draw() functions. As the game gets more complex I think we need some kind of state system / state machine to handle the different kinds of states.
I have coded a state system before with a state class: State.js and a state machine class: StateManager.js. Maybe we can use something similar.
The player has two stronger versions of itself.
In this zipped movie, I show off the strongest version:
All three versions, however, are killed by a single shot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.