DEV Community

Cover image for Alien Waves
Justin Young Subscriber for Excalibur

Posted on

Alien Waves

This is a submission for the Web Game Challenge, Build a Game: Alien Edition

What I Built

This is a tower defense game based on the theme of Aliens. Your ship is stranded on an unknown alien planet and you must defend yourself from the waves of aliens that attack your ship!

You can click or touch the playing field to place defense turrets on the level to deal with the waves of Aliens that spawn.

Each level will increase in difficulty, so you really need to be wise regarding how you balance your wave funds between cheap turrets and the expensive turrets.

There are no AI generated assets in this game.

Demo

Web Game on Itch.io

Journey

This game is made using Excalibur.js, a free and open source Typescript 2d game engine. Its a solo developed game. I am a member of the Excalibur community, and I have contributed to the Excalibur.js project.

Excalibur Discord Invite

The GitHub Project is located here: GitHub Repo

Biggest Lesson Learned: I have a long way to go to learn real UI/UX skills. But this is a journey, not a destination. ;)

Techniques implemented in this project

Finite State Machines: This uses a FSM library I wrote to use with Excalibur.js. A state machine was used for:

  • Wave Management
  • Unit animations

Screen Elements: This is a special type of entity in Excalibur.js. Usually, I use a UI-binding library to place a DOM layer over my game canvas. This is my first usage of the built-in UI entities in Excalibur.js.

9-slice UI component: I created a reusable Graphic for Excalibur.js to create 'panels' based on a base sprite. This allows for a standard sprite tile to be 'split' into 9 sections and either stretched or tiled appropriate to create custom panels.

Shaders: Not a massive implementation of shaders, but I use a base texture sprite for the laser blasts and then use a tinting shader to distinguish between each type of blast.

Re-usable components: I was pretty happy with the Health Bar that i created as a component for each entity, and after a few iterations, i was able to make it configurable upon each units Initialization. This saved a lot of time.

Signals: Taking inspiration from Godot's Signals, I created a custom signals library that is essentially a pub/sub system to create a event bus of custom JS events. An example of this is the GameOver signal, which each entity subscribes to, and when the game is over, that signal clears all existing entities from the board.

Roadmapped Development

Being a 10 day competition, the original intention was to hit a MVP level submission, which I was able to accomplish about 7-8 days into it. Over past 2 days of competition, I've been adding additional content to the game. This included the development of a 2nd turret, and a 2nd Enemy type. Other ideas for future features include:

  • Power ups dropped by enemies
  • More enemies, more turrets
  • Add options screen to control music and SFX better

Asset Attributions

The alien sprites were created with the Kenney's Creature Mixer tool.

The blast sprites from the turrets use particle sprites from Kenney's Particle Pack.

The ship is from Kenney's Ship Mixer tool.

The turrets I drew in Aseprite.

Sound Effects are generated with the Excalibur JSFXR plugin which I created.

Background Music is using a Chiptune generator I created from a fork of Vitling's Autotracker

Level texture was used from Itch.io texture pack Texture Pack from user FlakDeau19... special thanks to them for their VERY permission license.

Top comments (11)

Collapse
 
end3r profile image
Andrzej Mazur

Congratulations once again, it was a pleasure to judge the entries and pick yours as the winning one!

Collapse
 
jyoung4242 profile image
Justin Young

Thank you very much! It was a ton of fun to pull together!

Collapse
 
miketalbot profile image
Mike Talbot ⭐

I really enjoyed playing that. I ended up with a lot of towers and they seemed to stop firing so often, but had a lot of fun getting to that point :)

Collapse
 
jyoung4242 profile image
Justin Young

Thanks for the feedback, I'm working on an Object Pooling pattern using Excalibur's built in pool classes so that it better utilizes memory. What I learned during this is the process of creating/killing off Actors (game objects) is pretty expensive, so an object Pool would potentially help that greatly.... Thanks for the feedback, I'm glad you enjoyed it!

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

There might be a bit of game balancing there. After I found the "trick to it", I could dominate the playing surface with a lot of towers. But that felt like a really fun part of the game too, so I am unsure if it is what you intend. I ended up stopping when it felt like the fire rate dropped significantly due to the dozens of towers causing the lag.

At this point adding tower slows down the rate of enemy destruction :) But as you can see, I wanted to try again lol...

Great work

Overwhelming odds

Thread Thread
 
jyoung4242 profile image
Justin Young

This is awesome, I've received quite a bit of images from people who have clearly played the game much longer than I ever imagined. You mentioned balancing, and I fully agree with that. When these short game jams or game competitions happen, there's rarely enough time to do enough playtesting to really dial in the balancing properly. Thanks again, I am super glad you enjoyed it!

Collapse
 
jyoung4242 profile image
Justin Young

just pushed version 1.3.0, which adds object pooling for improved memory utilization, and removing lag from object creation/deletion processes

Collapse
 
martinbaun profile image
Martin Baun

Good luck!

Collapse
 
jyoung4242 profile image
Justin Young

Thank you very much!

Collapse
 
dansilcox profile image
Dan Silcox

That game is awesome! So simple but so effective

Collapse
 
jyoung4242 profile image
Justin Young

Thanks so much for that feedback! I’m glad to hear that you enjoyed it!