Documentation ¶
Index ¶
- Constants
- Variables
- func CheckError(err error) bool
- type CameraController
- type GameScene
- type Map
- func (m *Map) CheckCollision(worldPosition engine.Vector, width, height float32) bool
- func (m *Map) Draw()
- func (m *Map) GenerateCollision()
- func (m *Map) GenerateCollision2()
- func (m *Map) GetCollisions(worldPosition engine.Vector, width, height float32) (x, y []int)
- func (m *Map) GetCollisions2(worldPosition engine.Vector, width, height float32, ...) (x, y []int)
- func (m *Map) GetTile(x, y int) (tile Tile, exists bool)
- func (m *Map) GetTilePos(x, y int) (pos engine.Vector, exists bool)
- func (m *Map) IsTileWalkabke(x, y int) bool
- func (m *Map) PositionToTile(worldPosition engine.Vector) (tile Tile, x, y int)
- func (m *Map) Start()
- func (m *Map) Update()
- type Player
- type PlayerController
- type Tile
- func (t Tile) Angle() float32
- func (t Tile) Angle2() float32
- func (t Tile) Collision() Tile
- func (t Tile) LayerConnected() bool
- func (t Tile) SetCollision(collision Tile) Tile
- func (t Tile) SetLayerConnection(on bool) Tile
- func (t Tile) SetSide(side Tile) Tile
- func (t Tile) SetSide2(side Tile) Tile
- func (t Tile) SetType(typ byte) Tile
- func (t Tile) SetType2(typ2 byte) Tile
- func (t Tile) Side() Tile
- func (t Tile) Side2() Tile
- func (t Tile) Type() Tile
- func (t Tile) Type2() Tile
Constants ¶
View Source
const ( SideRight = Tile(1 << iota) SideUp = Tile(1 << iota) SideRight2 = Tile(1 << iota) SideUp2 = Tile(1 << iota) CollisionLeft = Tile(1 << iota) CollisionRight = Tile(1 << iota) CollisionUp = Tile(1 << iota) CollisionDown = Tile(1 << iota) LayerConnection = Tile(1 << iota) SideLeft = Tile(0) SideDown = SideRight | SideUp SideReset = ^SideDown SideLeft2 = Tile(0) SideDown2 = SideRight2 | SideUp2 SideReset2 = ^SideDown2 CollisionNone = Tile(0) CollisionAll = CollisionLeft | CollisionRight | CollisionUp | CollisionDown CollitionReset = ^CollisionAll LayerConnectionReset = ^LayerConnection )
Variables ¶
View Source
var ( GameSceneGeneral *GameScene TileAtlas *engine.ManagedAtlas TileIDs []engine.ID PlayerID engine.ID MainPlayer *Player Layers []*Map Mouse *engine.GameObject )
Functions ¶
func CheckError ¶
Types ¶
type CameraController ¶
type CameraController struct { engine.BaseComponent Speed float64 }
func NewCameraCtl ¶
func NewCameraCtl(speed float64) *CameraController
func (*CameraController) Update ¶
func (sp *CameraController) Update()
type GameScene ¶
type GameScene struct { *engine.SceneData Layer1 *engine.GameObject Layer2 *engine.GameObject Layer3 *engine.GameObject }
func (*GameScene) LoadTextures ¶
func (s *GameScene) LoadTextures()
type Map ¶
type Map struct { engine.BaseComponent Sprite *engine.Sprite Tiles []Tile Width, Height int TileSize float32 Disco float32 DiscoStyle int EnableDisco bool Layer int // contains filtered or unexported fields }
func (*Map) CheckCollision ¶
func (*Map) GenerateCollision ¶
func (m *Map) GenerateCollision()
func (*Map) GenerateCollision2 ¶
func (m *Map) GenerateCollision2()
func (*Map) GetCollisions ¶
func (*Map) GetCollisions2 ¶
func (*Map) IsTileWalkabke ¶
func (*Map) PositionToTile ¶
type Player ¶
type Player struct { engine.BaseComponent Map *Map }
type PlayerController ¶
type PlayerController struct { engine.BaseComponent Player *Player Joint *chipmunk.PivotJoint JointGameObject *engine.GameObject WalkSpeed float32 }
func NewPlayerController ¶
func NewPlayerController(player *Player) *PlayerController
func (*PlayerController) FixedUpdate ¶
func (this *PlayerController) FixedUpdate()
func (*PlayerController) Start ¶
func (this *PlayerController) Start()
type Tile ¶
type Tile int64
func (Tile) LayerConnected ¶
func (Tile) SetCollision ¶
func (Tile) SetLayerConnection ¶
Click to show internal directories.
Click to hide internal directories.