Train Defense 2‎ > ‎

More turrets, Air vehicles and Hammers

posted Jul 27, 2012, 10:00 AM by James Podesta   [ updated Jul 27, 2012, 10:03 AM ]
Just miscellaneous ports this time. Train Defense has 15 enemies and about 20 turrets, each unique in some way, so lots of bits and pieces to port.

Do today I've added an Air propulsion script for the air units, as well as a simple spinning attachment for their blades. I ported the hammer for the small and large ground enemy. The hammer does damage but I've made the train invincible for now.

I've done the twinshooter turret and the laser - the laser is what your seeing below. There's no way to switch turrets in the current build. They are a bit lackluster still without particles, red flashes and camera shake, but functionally its working.

I've started working on the Artillery turret, but its 3am and its not going to happen tonight. Each turret projectile is fairly unique. I shared a lot of code in a messy uber projectile system in Train Defense 1,  but it was often painful to do anything unique since they always had to fit in with assumptions made in the hierachy. With Unity components, I've avoided doing any hierarchical reuse. A projectile script handles the bullets, and a turret script handles the turret. The turret script only works with a particular projectile type, since the targetting and firing procedure can be quite unique from one turret to another. This means some cut & paste and duplicating code, but its only a few lines and stops anything from getting messy or making any assumptions about how a bullet should work.

Train Defense Prototype 007