Inspiration

I've played a few war games, like The Great Endeavor and Advance Wars, and I thought it would be fun to try to create something similar for myself.

What it does

The program is a game that takes heavy inspiration from tactical games from, as said above, from other war games. It's a simple two-player game where the players try to destroy the other person's base. The players can use units to attack one another. Once a unit walks onto the other person's base, they win. The program utilizes objects to make the program do what it does and so that isn't a headache to create.

How I built it

I created the program using Java in the Eclipse environment. As said above, I used objects to make creating the game easier. I used objects to create the units. I used objects to store the player's information, which includes a list of the units, which are objects. I also used a function I created that returns a value depending on whether there is a unit on a certain space, and a variation that got the list ID value of a unit on a given space.

Challenges I ran into

One challenge I ran into was trying to get rid of any unnecessary blocks of code that would either print UI elements or print debug statements (If you look closely at the demo video, because I didn't catch one of the bugs, it prints the y-value of the unit moving). Another challenge was managing what I should and shouldn't put in. Originally I planned for there to be three different unit types and terrain generation, but then I realized that I didn't have time for putting in either of them, so I only created one unit type (other than the base) and left out terrain generation.

Accomplishments that I'm proud of

I'm really proud of the unit buying system in the game. I didn't expect it to work first try, but by some miracle it did. I'm also proud of figuring out how to get units to mot move onto a stack of enemy units after attacking one of them, despite it being extremely simple.

What I learned

I learned that when dealing with deadlines, it's not a good idea to want to put a thousand features into the project because there won't be enough time to put all of it in. Instead it's better to have something very simple as a prototype. I also learned that objects are one of the most helpful things in programming because they prevent the need for thousands of lists upon lists upon lists.

What's next for Text War

Probably I am going to either try to implement some of the mechanics that I couldn't implement within the time restraint of a day and a bit, like the terrain generation or adding in a few new units. I might also make a better UI than text input because it looks kind of ugly, once I figure out how to do that.

Built With

Share this project:

Updates