Chapter 7: Weapons and Projectiles

https://leanpub.com/gameprogramminggolang

Technical requirements

https://leanpub.com/gameprogramminggolang

Weapons and projectiles in games

https://leanpub.com/gameprogramminggolang

The cursor: a pointer that follows the mouse

https://leanpub.com/gameprogramminggolang

Screen space versus world space

https://leanpub.com/gameprogramminggolang

Defining the Cursor type

https://leanpub.com/gameprogramminggolang

Updating the cursor each frame

https://leanpub.com/gameprogramminggolang

The timer: a cooldown for the weapon

https://leanpub.com/gameprogramminggolang

Implementing the Timer

https://leanpub.com/gameprogramminggolang

Driving the weapon cooldown with the timer

https://leanpub.com/gameprogramminggolang

Wiring the weapon and pool into the game

https://leanpub.com/gameprogramminggolang

The projectile: layers and spawn logic

https://leanpub.com/gameprogramminggolang

Spawn position and direction

https://leanpub.com/gameprogramminggolang

Rotating the projectile

https://leanpub.com/gameprogramminggolang

Collision: a projectile kills an enemy

https://leanpub.com/gameprogramminggolang

Why the queue must deduplicate

https://leanpub.com/gameprogramminggolang

Walking the queue

https://leanpub.com/gameprogramminggolang

The three removal branches

https://leanpub.com/gameprogramminggolang

Projectile movement and cleanup

https://leanpub.com/gameprogramminggolang

The projectile type and its pool

https://leanpub.com/gameprogramminggolang

The bloody knife weapon

https://leanpub.com/gameprogramminggolang

Constants and data structures

https://leanpub.com/gameprogramminggolang

Running the chapter

https://leanpub.com/gameprogramminggolang

Enemy waves: the spawner and the EnemyManager

https://leanpub.com/gameprogramminggolang

Spawning off-screen

https://leanpub.com/gameprogramminggolang

The enemy node

https://leanpub.com/gameprogramminggolang

Wave timing and escalation

https://leanpub.com/gameprogramminggolang

Summary

https://leanpub.com/gameprogramminggolang