Documentation
¶
Index ¶
- type Avatar
- func (subject *Avatar) CollideWithPlayer(futurePosX, futurePosY int) bool
- func (subject *Avatar) Copy() Avatar
- func (subject *Avatar) DistanceFromAvatar(subject2 *Avatar) float64
- func (subject *Avatar) Draw(mapContainer *fyne.Container)
- func (subject *Avatar) Move(mapContainer *fyne.Container, futurePosX, futurePosY int)
- func (subject *Avatar) MoveTowardsAvatar(subject2 *Avatar) (int, int)
- func (subject *Avatar) Refresh()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Avatar ¶
type Avatar struct {
CanvasImage *canvas.Image
CanvasPath string
Coord coord.Coord
ObjectInMapContainer *fyne.CanvasObject
}
func (*Avatar) CollideWithPlayer ¶
CollideWithPlayer returns true if we are going to collide with player, false instead.
func (*Avatar) DistanceFromAvatar ¶
DistanceFromAvatar computes the distance between 2 Avatars.
func (*Avatar) Draw ¶
func (subject *Avatar) Draw(mapContainer *fyne.Container)
Draw displays an avatar's image on the mapContainer.
func (*Avatar) MoveTowardsAvatar ¶
MoveTowardsAvatar is a trivial pathfinding algorithm for NPCs.
Click to show internal directories.
Click to hide internal directories.