components

package
v0.0.0-...-27af21b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ZOMBIE_FOLLOW_RANGE int64 = 25

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityId

type EntityId int64

type Player

type Player struct {
	ID        EntityId
	OldChunkX int64
	OldChunkY int64
	Inventory *inventory.Inventory
	Conn      net.Conn

	LastMovementTime time.Time
	LastAttackTime   time.Time

	Username    string
	Gold        int64
	HP          int64
	ST          int64
	Speed       byte    // how many blocks per second the player can travel (water speed is Speed/2)
	AttackSpeed float32 // how many times the player can attack per second

	Hostile bool
}

func NewPlayer

func NewPlayer(entityId EntityId, inv []byte, c net.Conn) *Player

type Position

type Position struct {
	X int64
	Y int64
}

func NewPositionComponent

func NewPositionComponent(x, y int64) *Position

type Sprite

type Sprite struct {
	Character  rune
	Foreground tcell.Color
	Background tcell.Color
}

func NewSpriteComponent

func NewSpriteComponent(character rune, foreground, background tcell.Color) *Sprite

type Zombie

type Zombie struct {
	ID                EntityId
	HP                int64
	Damage            int64
	GoldDropAmt       int64
	FollowingPlayerId EntityId // -1 if not following anyone

	LastAttackTime time.Time
}

func NewZombieComponent

func NewZombieComponent(entityId EntityId, x, y int64) *Zombie

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳