2019-11-05 16:44:50 +03:00

38 lines
660 B
Go

package mob
import (
"fmt"
"lab.zaar.be/thefish/alchemyst-go/engine/gamemap"
"lab.zaar.be/thefish/alchemyst-go/engine/types"
"reflect"
)
type Mob struct {
*types.Appearance
types.Coords
BlocksPass bool
}
func (m *Mob) Walk(level *gamemap.Level, dx, dy int) {
newCoords := types.Coords{m.X + dx, m.Y + dy}
if level.GetTile(newCoords).BlocksPass {
return
}
//fixme
//if level.Objects.At(newCoords).HasComponent("block_pass") {
//
//}
fmt.Printf("new coords: %d, %d\n", m.Coords.X, m.Coords.Y)
}
func (m *Mob) Render() {
}
func (m *Mob) MoveToCoords(c types.Coords) {
}
func (mob Mob) TypeOf() reflect.Type {
return reflect.TypeOf(mob)
}