New Collectibles entity, which encompasses Power-Ups and any future collectible item (ie coins, health, etc for future implementations)
Very easy to implement power-ups; I first check to see if there are collisions. Then I run through a switch statement applying the power-up effect to the goat. Once power-up duration timer is up, I simply reverse the effects. Then the Collectible entity is marked for removal.
Currently 6 Powerups.
Effects can stack with other Power-Ups, including the same Power-Up.
Effects last for a set duration upon pickup (10sec)
Spawns in random position on stage, at a set interval (10sec)
If not picked up, will disappear after a set time (15sec)
Speed-Up: Increases velocity of Goat for a short period.
Double-Jump: Adds extra jump. Stacked power-ups of these means triple, quadruple jumps, etc.
High-Jump: Adds extra height to jumps. Stacked power-ups increase height even further.
Max-Charge: Gives goat maximum charge power for a duration.
Attack-Up: Allows goat to attack more than one goat a time. By default a goat can only attack one goat during a charge.
Invincibility: Goat is invulnerable to attacks for a duration.
THINGS STILL NEEDED TO BE DONE
Make the power-up sprites animated (bouncing/floating up and down)
Indicate which power-up a goat currently has (probably by displaying tiny icons near the charge meter. I added icons in addition to the power-up sprites for this reason.)
Think of other ways to indicate what power-up a goat has
POWERUPS!
Collectibles
entity, which encompasses Power-Ups and any future collectible item (ie coins, health, etc for future implementations)Speed-Up: Increases velocity of Goat for a short period.
Double-Jump: Adds extra jump. Stacked power-ups of these means triple, quadruple jumps, etc.
High-Jump: Adds extra height to jumps. Stacked power-ups increase height even further.
Max-Charge: Gives goat maximum charge power for a duration.
Attack-Up: Allows goat to attack more than one goat a time. By default a goat can only attack one goat during a charge.
Invincibility: Goat is invulnerable to attacks for a duration.
THINGS STILL NEEDED TO BE DONE