doodle/pkg/doodads/dummy/dummy.go
Noah Petherbridge 1a8a5eb94b Polish and bugfixes
- Fix a memory sharing bug in the Giant Screenshot feature.
- Main Menu to eagerload chunks in the background to make scrolling less
  jittery. No time for a loadscreen!
- Extra script debugging: names/IDs of doodads are shown when they send
  messages to one another.
- Level Properties: you can edit the Bounded max width/height values for
  the level.

Doodad changes:

- Buttons: fix a timing bug and keep better track of who is stepping on it,
  only popping up when all colliders have left. The effect: they pop up
  immediately (not after 200ms) and are more reliable.
- Keys: zero-qty keys will no longer put themselves into the inventory of
  characters who already have one except for the player character. So
  the Thief will not steal them if she already has the key.

Added to the JavaScript API:

* time.Hour, time.Minute, time.Second, time.Millisecond, time.Microsecond
2021-10-09 20:45:38 -07:00

48 lines
1.1 KiB
Go

// Package dummy implements a dummy doodads.Drawing.
package dummy
import (
"git.kirsle.net/apps/doodle/pkg/doodads"
"git.kirsle.net/go/render"
)
// Drawing is a dummy doodads.Drawing that has no data.
type Drawing struct {
Drawing *doodads.Drawing
}
// NewDrawing creates a new dummy drawing.
func NewDrawing(id string, doodad *doodads.Doodad) *Drawing {
return &Drawing{
Drawing: doodads.NewDrawing(id, doodad),
}
}
// Size returns the size of the underlying doodads.Drawing.
func (d *Drawing) Size() render.Rect {
return d.Drawing.Size()
}
// MoveTo changes the drawing's position.
func (d *Drawing) MoveTo(to render.Point) {
d.Drawing.MoveTo(to)
}
// Grounded satisfies the collision.Actor interface.
func (d *Drawing) Grounded() bool {
return false
}
// SetGrounded satisfies the collision.Actor interface.
func (d *Drawing) SetGrounded(v bool) {}
// Position satisfies the collision.Actor interface.
func (d *Drawing) Position() render.Point {
return render.Point{}
}
// Hitbox satisfies the collision.Actor interface.
func (d *Drawing) Hitbox() render.Rect {
return render.Rect{}
}