working on doors

master
Jordan Orelli 4 years ago
parent 87fa287fa3
commit 1a048f79f7

@ -8,6 +8,8 @@ import (
type door struct { type door struct {
*blammo.Log *blammo.Log
to string
exit int
} }
func (d *door) update(time.Duration) {} func (d *door) update(time.Duration) {}
@ -26,18 +28,45 @@ func (d *door) onStopOverlap(e *entity) {
/* /*
··········
·····@····
··········
··········
·········· ····················
·····d···--------···················
·········· ····················
··········
··········
·········
··········
·····@····
··········
··········
·········· ····················
·····d····--------····················
·········· ····················
··········
··········
·········
·········· ··········
·····@····
··········
··········
······························
·····d························
······························
··········
·········· ··········
·········· ·········
··········
··········
·····d····
··········
··········
··········
··········
*/ */

@ -67,6 +67,8 @@ func newWorld(log *blammo.Log) *world {
Glyph: '◇', Glyph: '◇',
behavior: &door{ behavior: &door{
Log: log.Child("door"), Log: log.Child("door"),
to: "hall",
exit: -5,
}, },
}) })
@ -78,6 +80,17 @@ func newWorld(log *blammo.Log) *world {
players: make(map[string]*player), players: make(map[string]*player),
} }
hall.addEntity(&entity{
ID: -5,
Position: math.Vec{0, 2},
Glyph: '◇',
behavior: &door{
Log: log.Child("door"),
to: "foyer",
exit: -4,
},
})
log.Info("created foyer with bounds: %#v having width: %d height: %d area: %d", foyer.Rect, foyer.Width, foyer.Height, foyer.Area()) log.Info("created foyer with bounds: %#v having width: %d height: %d area: %d", foyer.Rect, foyer.Width, foyer.Height, foyer.Area())
return &world{ return &world{
Log: log, Log: log,

Loading…
Cancel
Save