Documentation ¶
Index ¶
- Constants
- Variables
- func DegreesToRadians(degrees float64) float64
- func Distance(a, b Position) float64
- func Filter(arr []Task, f func(Task) bool) []interface{}
- func GetDxDyDir(a, b *Position) (dx int, dy int, dir joystick.Dir)
- func GetEntityTile(g *Game, entity Entity) (*Tile, *Position)
- func GetFont(name string) font.Face
- func GetResource(name ResourceName) *ebiten.Image
- func GetSurroundedTiles(tilePos Position, g *Game) (center, up, left, down, right *Tile, tiles []*Tile, err error)
- func GetTileSize() int
- func LoadResources() error
- func ScaleImage(img *ebiten.Image) *ebiten.Image
- func SetTimeout(t int, f func())
- type AllPlayerFeatures
- type Board
- type Bomb
- type BombEffect
- type BombState
- type DefaultImageCords
- type Enemy
- func (e *Enemy) AllowedTile(t *Tile) bool
- func (e *Enemy) Die(g *Game) error
- func (e *Enemy) Draw(boardImage *ebiten.Image) error
- func (e *Enemy) GetFeatures() Features
- func (p *Enemy) GetName() string
- func (e *Enemy) GetNearTile(g *Game) *Tile
- func (p *Enemy) GetPosition() *Position
- func (p *Enemy) GetSize() int
- func (e *Enemy) Move(g *Game)
- func (e *Enemy) Update(g *Game) error
- type EnemyFamily
- type EnemyState
- type Entity
- type Features
- type Game
- func (g *Game) AddBomb(pos *Position, lifeTime int)
- func (g *Game) AddEnemy()
- func (g *Game) AddPickable(kind PickableEnum)
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
- func (g *Game) RemoveBomb(bomb *Bomb)
- func (g *Game) RemoveEnemy(enemy *Enemy)
- func (g *Game) SetScreen(s GameScreen)
- func (g *Game) Update() error
- type GameScreen
- type Header
- type ISprite
- type Level
- type Offsets
- type Pickable
- type PickableEnum
- type Player
- func (p *Player) AddTask(action joystick.Action)
- func (p *Player) Animate(game *Game) error
- func (p *Player) CurrentImage() *ebiten.Image
- func (p *Player) Die(g *Game) error
- func (p *Player) Draw(boardImage *ebiten.Image) error
- func (p *Player) GetFeatures() Features
- func (p *Player) GetName() string
- func (p *Player) GetNextTile(g *Game, direction joystick.Dir) *Tile
- func (p *Player) GetPosition() *Position
- func (p *Player) GetSize() int
- func (p *Player) Move(g *Game)
- func (p *Player) RunTasks(game *Game) error
- func (p *Player) Update(game *Game) error
- func (p *Player) UpgradePlayer() error
- type PlayerState
- type Position
- type PrevEntry
- type ResourceName
- type ScreenOptions
- type Sprite
- type Task
- type Tile
Constants ¶
View Source
const ( TileKindEmpty = 0 TileKindWall = 1 TileKindWood = 2 )
Variables ¶
View Source
var ( Zoom = 2 ScreenWidth = 12 * GetTileSize() ScreenHeight = 16 * GetTileSize() )
View Source
var (
HeaderHeight = 20
)
Functions ¶
func DegreesToRadians ¶
func GetResource ¶
func GetResource(name ResourceName) *ebiten.Image
func GetSurroundedTiles ¶
func GetTileSize ¶
func GetTileSize() int
func LoadResources ¶
func LoadResources() error
func ScaleImage ¶
func ScaleImage(img *ebiten.Image) *ebiten.Image
func SetTimeout ¶
func SetTimeout(t int, f func())
Types ¶
type AllPlayerFeatures ¶
type Bomb ¶
type Bomb struct {
// contains filtered or unexported fields
}
func (*Bomb) MakeBombEffects ¶
type BombEffect ¶
type BombEffect struct {
// contains filtered or unexported fields
}
func NewBombEffect ¶
func NewBombEffect(pos Position, playerPosition *Position) *BombEffect
func (*BombEffect) Draw ¶
func (b *BombEffect) Draw(boardImage *ebiten.Image) error
func (*BombEffect) Update ¶
func (b *BombEffect) Update(g *Game) error
type DefaultImageCords ¶
type DefaultImageCords struct {
// contains filtered or unexported fields
}
type Enemy ¶
type Enemy struct {
// contains filtered or unexported fields
}
func (*Enemy) AllowedTile ¶
func (*Enemy) GetFeatures ¶
func (*Enemy) GetNearTile ¶
func (*Enemy) GetPosition ¶
type EnemyFamily ¶
type EnemyFamily string
const ( Chort EnemyFamily = "chort" Orc EnemyFamily = "orc" )
type EnemyState ¶
type EnemyState string
const ( EnemyStateIdle EnemyState = "idle" EnemyStateAttack EnemyState = "walk" EnemyStateDead EnemyState = "dead" )
type Game ¶
type Game struct { UiComponents map[GameScreen][]ui.Component // contains filtered or unexported fields }
func (*Game) AddPickable ¶
func (g *Game) AddPickable(kind PickableEnum)
func (*Game) Draw ¶
func (g *Game) Draw(screen *ebiten.Image)
Draw draws the game screen. Draw is called every frame (typically 1/60[s] for 60Hz display).
func (*Game) Layout ¶
Layout takes the outside size (e.g., the window size) and returns the (logical) screen size. If you don't have to adjust the screen size with the outside size, just return a fixed size.
func (*Game) RemoveBomb ¶
func (*Game) RemoveEnemy ¶
func (*Game) SetScreen ¶
func (g *Game) SetScreen(s GameScreen)
type GameScreen ¶
type GameScreen int
const ( GameScreenPlay GameScreen = iota GameScreenGameOver GameScreenPause GameScreenStart )
type ISprite ¶
type ISprite interface { Animate() error SetCurrent(*ebiten.Image) GetCurrent() *ebiten.Image IsAnimation() bool }
func GetSpriteByKind ¶
func NewAnimatedSprite ¶
type Pickable ¶
type Pickable struct {
// contains filtered or unexported fields
}
func NewPickable ¶
func NewPickable(kind PickableEnum, pos *Position) *Pickable
func (*Pickable) GetKind ¶
func (p *Pickable) GetKind() PickableEnum
func (*Pickable) GetPosition ¶
type PickableEnum ¶
type PickableEnum int
const ( PickableEnumPower PickableEnum = iota PickableEnumSpeed PickableEnumLife PickableEnumMaxItems )
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (*Player) CurrentImage ¶
func (p *Player) CurrentImage() *ebiten.Image
func (*Player) GetFeatures ¶
func (*Player) GetPosition ¶
func (*Player) UpgradePlayer ¶
type PlayerState ¶
type PlayerState string
const ( PlayerStateIdle PlayerState = "idle" PlayerStateWalk PlayerState = "walk" PlayerStateDie PlayerState = "die" )
type Position ¶
func GetTileBoardPos ¶
type ResourceName ¶
type ResourceName string
const ( ResourceNameChortIdle ResourceName = "chort_idle" ResourceNameChostRun ResourceName = "chort_run" ResourceNameDoor ResourceName = "door" ResourceNameWall ResourceName = "wall" ResourceNameWallFountain ResourceName = "wall_fountain" ResourceNameLizardIdle ResourceName = "lizard_idle" ResourceNameLizardRun ResourceName = "lizard_run" ResourceNameChestAnim ResourceName = "chest_anim" ResourceNameFlaskBlue ResourceName = "flask_blue" ResourceNameFloor ResourceName = "floor" ResourceNameReplay ResourceName = "replay" ResourceNameBoomIdle ResourceName = "boom_idle" ResourceNameBoomOn ResourceName = "boom_on" )
type ScreenOptions ¶
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
func (*Sprite) GetCurrent ¶
func (s *Sprite) GetCurrent() *ebiten.Image
func (*Sprite) IsAnimation ¶
func (*Sprite) SetCurrent ¶
func (s *Sprite) SetCurrent(i *ebiten.Image)
type Tile ¶
type Tile struct {
// contains filtered or unexported fields
}
func GetSurroundedTilesArray ¶
func GetTileByBoardPosition ¶
Click to show internal directories.
Click to hide internal directories.