Documentation
¶
Index ¶
- Constants
- Variables
- func CheckError(err error) bool
- func Connect(name string, errChan *chan error)
- func CreatePowerUp(position engine.Vector)
- func LoadTextures()
- func PowerUpShip(p Power)
- func SpawnMainPlayer(spawnPlayer server.SpawnPlayer)
- func SpawnPlayer(spawnPlayer server.SpawnPlayer)
- type Background
- type Client
- type DamageDealer
- type Destoyable
- type DestoyableFuncs
- type EnemeyAI
- type EnemeyType
- type GameScene
- type Missle
- type MouseDebugger
- type Power
- type PowerUp
- type ResizeScript
- type ShipController
Constants ¶
View Source
const ( Enemey_Boss = iota Enemey_Cookie )
View Source
const ( Speed = Power(2) Damage = Power(1) Range = Power(6) HP = Power(5) )
View Source
const ( MissleTag = "Missle" CookieTag = "Cookie" )
View Source
const HPGUI_A = 124
View Source
const HP_A = 123
View Source
const Jet_A = 125
View Source
const Missle_A = 334
View Source
const Queen_A = 666
View Source
const ServerIP = "localhost:123"
View Source
const ServerLocalIP = "localhost:123"
Variables ¶
View Source
var ( PowerUpChance = 2 PowerUpRepairChance = 5 )
View Source
var ( GameSceneGeneral *GameScene Player *engine.GameObject PlayerShip *ShipController Explosion *engine.GameObject PowerUpGO *engine.GameObject Wall *engine.GameObject ArialFont *engine.Font ArialFont2 *engine.Font Players map[server.ID]*engine.GameObject = make(map[server.ID]*engine.GameObject) )
View Source
var Explosion_ID engine.ID
View Source
var PowerUps_ID engine.ID
View Source
var SpaceShip_A = "Ship"
Functions ¶
func CheckError ¶
func CreatePowerUp ¶
func LoadTextures ¶
func LoadTextures()
func PowerUpShip ¶
func PowerUpShip(p Power)
func SpawnMainPlayer ¶
func SpawnMainPlayer(spawnPlayer server.SpawnPlayer)
func SpawnPlayer ¶
func SpawnPlayer(spawnPlayer server.SpawnPlayer)
Types ¶
type Background ¶
type Background struct {
engine.BaseComponent
// contains filtered or unexported fields
}
func NewBackground ¶
func NewBackground(sprite *engine.Sprite) *Background
func (*Background) Draw ¶
func (sp *Background) Draw()
type Client ¶
type Client struct {
engine.BaseComponent
Socket *net.TCPConn
Name string
ID server.ID
Ship *ShipController
Encoder *gob.Encoder
Decoder *gob.Decoder
Jobs chan func()
GameJobs chan func()
Disconnected bool
// contains filtered or unexported fields
}
func (*Client) HandlePacket ¶
func (*Client) LateUpdate ¶
func (c *Client) LateUpdate()
func (*Client) SendRespawn ¶
type DamageDealer ¶
type DamageDealer struct {
engine.BaseComponent
Damage float32
}
func NewDamageDealer ¶
func NewDamageDealer(dmg float32) *DamageDealer
type Destoyable ¶
type Destoyable struct {
engine.BaseComponent
Alive bool
HP float32
FullHP float32
Team int
// contains filtered or unexported fields
}
func NewDestoyable ¶
func NewDestoyable(hp float32, team int) *Destoyable
func (*Destoyable) OnCollisionEnter ¶
func (ds *Destoyable) OnCollisionEnter(arbiter engine.Arbiter) bool
func (*Destoyable) SetDestroyTime ¶
func (ds *Destoyable) SetDestroyTime(sec float32)
func (*Destoyable) Start ¶
func (ds *Destoyable) Start()
func (*Destoyable) Update ¶
func (ds *Destoyable) Update()
type DestoyableFuncs ¶
type DestoyableFuncs interface {
OnDie(byTimer bool)
OnHit(*engine.GameObject, *DamageDealer)
}
type EnemeyAI ¶
type EnemeyAI struct {
engine.BaseComponent
Target *engine.GameObject
Type EnemeyType
}
func NewEnemeyAI ¶
func NewEnemeyAI(target *engine.GameObject, typ EnemeyType) *EnemeyAI
func (*EnemeyAI) OnHit ¶
func (sp *EnemeyAI) OnHit(enemey *engine.GameObject, damager *DamageDealer)
type EnemeyType ¶
type EnemeyType int
type GameScene ¶
type GameScene struct {
*engine.SceneData
Layer1 *engine.GameObject
Layer2 *engine.GameObject
Layer3 *engine.GameObject
Layer4 *engine.GameObject
}
type Missle ¶
type Missle struct {
engine.BaseComponent
Speed float32
Explosion *engine.GameObject
// contains filtered or unexported fields
}
func (*Missle) OnComponentAdd ¶
func (ms *Missle) OnComponentAdd()
func (*Missle) OnHit ¶
func (ms *Missle) OnHit(enemey *engine.GameObject, damager *DamageDealer)
type MouseDebugger ¶
type MouseDebugger struct {
engine.BaseComponent
}
func NewMouseDebugger ¶
func NewMouseDebugger() *MouseDebugger
func (*MouseDebugger) Update ¶
func (m *MouseDebugger) Update()
type ResizeScript ¶
type ResizeScript struct {
engine.BaseComponent
MinX, MediumX, MaxX float32
MinY, MediumY, MaxY float32
State int
Speed float32
}
func NewResizeScript ¶
func NewResizeScript(minX, mediumX, maxX, minY, mediumY, maxY float32) *ResizeScript
func (*ResizeScript) SetValues ¶
func (m *ResizeScript) SetValues(minX, mediumX, maxX, minY, mediumY, maxY float32)
func (*ResizeScript) Update ¶
func (m *ResizeScript) Update()
type ShipController ¶
type ShipController struct {
engine.BaseComponent `json:"-"`
Speed float32
RotationSpeed float32
Missle *Missle `json:"-"`
MisslesPosition []engine.Vector
MisslesDirection [][]engine.Vector
MissleLevel int
MaxMissleLevel int `json:"-"`
Destoyable *Destoyable `json:"-"`
HPBar *engine.GameObject `json:"-"`
UseMouse bool `json:"-"`
JetFire *engine.GameObject `json:"-"`
JetFireParent *engine.GameObject `json:"-"`
JetFirePool []*ResizeScript `json:"-"`
JetFirePosition []engine.Vector `json:"-"`
FireSource *audio.AudioSource
// contains filtered or unexported fields
}
func NewShipController ¶
func NewShipController() *ShipController
func (*ShipController) OnComponentAdd ¶
func (sp *ShipController) OnComponentAdd()
func (*ShipController) OnDie ¶
func (sp *ShipController) OnDie(byTimer bool)
func (*ShipController) OnHit ¶
func (sp *ShipController) OnHit(enemey *engine.GameObject, damager *DamageDealer)
func (*ShipController) Shoot ¶
func (sp *ShipController) Shoot()
func (*ShipController) Start ¶
func (sp *ShipController) Start()
func (*ShipController) Update ¶
func (sp *ShipController) Update()
Click to show internal directories.
Click to hide internal directories.