Documentation
¶
Overview ¶
Package scripts holds this game's custom types. This is the pattern for extending Collider: embed *engine.Object in your own struct, add fields and methods, and the result is both a full engine object (Move, OnCollisionWith, velocity...) and your own domain type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
Player is an engine object extended with hit points and damage rules.
func (*Player) Reset ¶
func (p *Player) Reset()
Reset restores the player's stats for a fresh round. Position is handled by the engine's Restart snapshot; stats are the game's job.
func (*Player) TakeDamage ¶
TakeDamage applies damage unless the player is in the invulnerability window, then opens a new window for one second. Reports whether the hit landed.
Click to show internal directories.
Click to hide internal directories.