Capstone – Week 11 Retrospective

w e e k 1 1

My two biggest tasks for this week were the core economy (basically the purchasing system for traps) and the energy system.

Previously we had a set amount of traps you could place, but we wanted to weight the traps so that players couldn’t spam the powerful ones.

Core Economy

The core economy was a fairly basic purchasing system. The player has 15 “cores” represented by an int. Each trap has a cost, and you can’t purchase a trap if you don’t have enough cores to cover the cost. That was fairly simple to implement.

cores.gif

Energy System

The energy system was a bit more complex. Basically, I created an EnergyHandler class which I then attached to each trap. This keeps track of the current amount of energy the trap has, and it slowly decreases this supply it if the trap is not currently being charged. Now, instead of activating a trap being a binary on/off, a trap would only be activated if it had more than zero energy.

I also created a DroneEnergy class which handles the drone’s supply of energy. The drone replenishes its own supply by flying over to the goal area of its base. Basically the scripts which handle the drone’s activation radius colliding with the traps (if the drone has any energy left it will remove the energy) grab an amount of energy from the drone (if it has any left), store this in a local variable, and then give it to the trap.

energy.gif

Additionally, I added this collider which blocks traps from being placed if they are colliding with a wall (this is so players can’t place traps inside walls). It changes color based on whether you can currently place a trap or not.

previewCollider.gif

-“David Hartman”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s