interfaces

package
v0.0.0-...-281f1f0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Damageable

type Damageable interface {
	OnDamage(other SceneObject)
}

type DrawListener

type DrawListener interface {
	OnDraw()
}

type Physics

type Physics interface {
	MoveObjects(gameMap SceneMap, dt time.Duration)
	PathTo(from, to pixel.Vec, sceneMap consts2.LevelMap) []*pixel.Vec
}

type ResourceManager

type ResourceManager interface {
	GetSpriteMap(name consts2.ObjectType) *SceneObjectAnimateList
	LoadMap(path string) consts2.LevelMap
	PlaySound(name consts2.SoundType)
	CloseSound()
}

type Scene

type Scene interface {
	GetObjects() []SceneObject
	GetObjectByID(id int64) SceneObject
	RemoveObject(id int64)
	SetSceneObjects(objects []SceneObject)
	GetSceneMap() SceneMap
	GetLevelMap() consts2.LevelMap
	SetLevelMap(levelMap consts2.LevelMap)
	MakeEmptyObj(objType consts2.ObjectType) SceneObject
	Draw(target pixel.Target)
	GetSpawner() Spawner
}

type SceneMap

type SceneMap []SceneObject

SceneMap ...

type SceneObject

type SceneObject interface {
	GetID() int64
	GetScene() Scene
	GetPos() *pixel.Vec
	SetPos(vect *pixel.Vec)
	GetSpeed() *pixel.Vec
	SetSpeed(vect *pixel.Vec)
	GetSprite() *pixel.Sprite
	SetSpriteList(list *SceneObjectAnimateList)
	Draw(target pixel.Target)
	SetScale(scale pixel.Vec)
	GetScale() pixel.Vec
	GetSize() *pixel.Rect
	IsVisible() bool
	SetVisible(visible bool)
	AddChild(obj SceneObject)
	GetObjects() []SceneObject
	GetObjectType() consts2.ObjectType
	SetOrientation(orient consts2.Orientation)
	GetOrientation() consts2.Orientation
	NextSprite()
	Delete()
	OnCollide(obj SceneObject) // Коллизия произошла, вызываем этот метод
	GetGameObject() interface{}
	SetGameObject(gObj interface{})
	SetLife(life uint8)
	GetLife() uint8
}

SceneObject интерфейс

type SceneObjectAnimateList

type SceneObjectAnimateList map[consts2.Orientation][]*pixel.Sprite

SceneObjectAnimateList структуры анимации (для танков?)

type Spawner

type Spawner interface {
	Spawn(objType consts2.ObjectType, pos pixel.Vec)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL