diff --git a/internal/sim/door.go b/internal/sim/door.go index 38a5193..709ecc9 100644 --- a/internal/sim/door.go +++ b/internal/sim/door.go @@ -8,6 +8,8 @@ import ( type door struct { *blammo.Log + to string + exit int } func (d *door) update(time.Duration) {} @@ -26,18 +28,45 @@ func (d *door) onStopOverlap(e *entity) { /* + ┌──────────┐ + │··········│ + │·····@····│ + │··········│ + │··········│ ┌────────────────────┐ + │··········│ │····················│ + │·····d···◇│--------│◇···················│ + │··········│ │····················│ + │··········│ └────────────────────┘ + │··········│ + │·········◇│ + └──────────┘ -┌──────────┐ -│··········│ -│··········│ -│··········│ ┌──────┐ -│··········│ │ │ -│··········│ │ │ -│·····d····◇░░░░░░░░◇ │ -│··········│ │ │ -│··········│ │ │ -│··········│ └──────┘ -│··········◇ -└──────────┘ + + ┌──────────┐ + │··········│ + │·····@····│ + │··········│ + │··········│ ┌────────────────────┐ + │··········│ │····················│ + │·····d····◇--------◇····················│ + │··········│ │····················│ + │··········│ └────────────────────┘ + │··········│ + │·········◇│ + └──────────┘ + + + ┌──────────┐ + │··········│ + │·····@····│ + │··········│ + │··········│────────────────────┐ + │··········│····················│ + │·····d····◇····················│ + │··········│····················│ + │··········│────────────────────┘ + │··········│ + │·········◇│ + └──────────┘ */ diff --git a/internal/sim/world.go b/internal/sim/world.go index 2fe69c5..487352f 100644 --- a/internal/sim/world.go +++ b/internal/sim/world.go @@ -66,7 +66,9 @@ func newWorld(log *blammo.Log) *world { Position: math.Vec{9, 5}, Glyph: '◇', 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), } + 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()) return &world{ Log: log,