Documentation
¶
Index ¶
- Constants
- func Abs(x int) int
- func LowerBound(x, divisor int) int
- func Max(x, y int) int
- func Min(x, y int) int
- func UpperBound(x, divisor int) int
- type Animation
- type Bullet
- type ControlPanel
- type Direction
- type Element
- type Game
- type GameObject
- func (g *GameObject) Destroy()
- func (g *GameObject) Draw(screen *ebiten.Image)
- func (g *GameObject) GetCollisionSize() int
- func (g *GameObject) GetDir() Direction
- func (g *GameObject) GetPosition() Position
- func (g *GameObject) GetSpeed() int
- func (g *GameObject) GetType() ObjType
- func (g *GameObject) Stop()
- func (g *GameObject) Update(count int)
- type Ground
- type Input
- type ObjType
- type Position
- type Tank
- type TimerManager
Constants ¶
View Source
const ( ScreenWidth = 13 * tankSizeInPix ScreenHeight = 13 * tankSizeInPix )
View Source
const (
BulletBorderInPix = 15
)
Variables ¶
This section is empty.
Functions ¶
func LowerBound ¶
func UpperBound ¶
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
func GetBulletAnimation ¶
func GetBulletAnimation() *Animation
func GetP1TankAnimation ¶
func GetP2TankAnimation ¶
func NewAnimation ¶
type Bullet ¶
type Bullet struct { GameObject // contains filtered or unexported fields }
type ControlPanel ¶
type ControlPanel struct {
// contains filtered or unexported fields
}
func (*ControlPanel) Drive ¶
func (cp *ControlPanel) Drive(dir Direction)
func (*ControlPanel) Hold ¶
func (cp *ControlPanel) Hold()
func (*ControlPanel) PressFire ¶
func (cp *ControlPanel) PressFire()
func (*ControlPanel) UnPressFire ¶
func (cp *ControlPanel) UnPressFire()
type GameObject ¶
type GameObject struct { Position Dir Direction NextDir Direction Speed int Moving bool ID int ObjType ObjType Ground *Ground Destroyed bool // contains filtered or unexported fields }
func (*GameObject) Destroy ¶
func (g *GameObject) Destroy()
func (*GameObject) Draw ¶
func (g *GameObject) Draw(screen *ebiten.Image)
func (*GameObject) GetCollisionSize ¶
func (g *GameObject) GetCollisionSize() int
func (*GameObject) GetDir ¶
func (g *GameObject) GetDir() Direction
func (*GameObject) GetPosition ¶
func (g *GameObject) GetPosition() Position
func (*GameObject) GetSpeed ¶
func (g *GameObject) GetSpeed() int
func (*GameObject) GetType ¶
func (g *GameObject) GetType() ObjType
func (*GameObject) Stop ¶
func (g *GameObject) Stop()
func (*GameObject) Update ¶
func (g *GameObject) Update(count int)
type Ground ¶
func (*Ground) CollisionDetect ¶
type Tank ¶
type Tank struct { GameObject // contains filtered or unexported fields }
type TimerManager ¶
type TimerManager struct {
// contains filtered or unexported fields
}
var (
Timer *TimerManager
)
func NewTimer ¶
func NewTimer() *TimerManager
func (*TimerManager) AddEvent ¶
func (t *TimerManager) AddEvent(countDown int, fn func())
func (*TimerManager) Update ¶
func (t *TimerManager) Update()
Click to show internal directories.
Click to hide internal directories.