mirror of
https://github.com/stevenhowes/GoRetro.git
synced 2026-05-26 15:53:31 +01:00
Allow easy killing (with animation) of anything that has a DR. Useful for plausibly disposing of projectiles.
This commit is contained in:
@@ -25,6 +25,9 @@ func (dr *damageReceiver) onDraw() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dr *damageReceiver) onUpdate() error {
|
func (dr *damageReceiver) onUpdate() error {
|
||||||
|
if dr.container.Kill {
|
||||||
|
dr.health = -1
|
||||||
|
}
|
||||||
// If we're out of health
|
// If we're out of health
|
||||||
if dr.health <= 0 {
|
if dr.health <= 0 {
|
||||||
// If we have an animator, run the destroy sequence
|
// If we have an animator, run the destroy sequence
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ type Element struct {
|
|||||||
Rotation float64
|
Rotation float64
|
||||||
Active bool
|
Active bool
|
||||||
Delete bool
|
Delete bool
|
||||||
|
Kill bool
|
||||||
Collisions []Circle
|
Collisions []Circle
|
||||||
components []component
|
components []component
|
||||||
parentElement *Element
|
parentElement *Element
|
||||||
|
|||||||
Reference in New Issue
Block a user