Function Fighter
A turn-based combat game using JavaScript functions, objects, and arrays. Features critical damage, burn effects, and move systems.
Details
Why I built this
Nathan used Function Fighter to move from isolated JavaScript exercises into a larger game codebase. He planned new combat features, wrote functions, organized moves with objects and arrays, and worked through how a feature connects to the rest of a game.
Bugs and breakthroughs
- Worked through the challenge of integrating an abstract function into an existing codebase.
- Combined objects, arrays, and functions to implement burn damage.
- Practiced reading answer code to understand the structure instead of only copying it.
Proud code
const fireball = {
name: "Fireball",
damage: 12,
effect: "burn"
};
function applyBurn(target) {
target.health = target.health - 3;
}
This captures the objects-plus-functions pattern Nathan practiced while adding burn damage.