Documentation
¶
Index ¶
- type Player
- type PlayerImpl
- func (p *PlayerImpl) AddScore()
- func (p *PlayerImpl) GetBottom() float32
- func (p *PlayerImpl) GetCircle() shape.Circle
- func (p *PlayerImpl) GetClientID() int32
- func (p *PlayerImpl) GetHealth() float32
- func (p *PlayerImpl) GetID() int32
- func (p *PlayerImpl) GetLeft() float32
- func (p *PlayerImpl) GetName() string
- func (p *PlayerImpl) GetNextReload() time.Time
- func (p *PlayerImpl) GetPlayerProto() *Message_proto.Player
- func (p *PlayerImpl) GetPosition() common.Point
- func (p *PlayerImpl) GetRect() shape.Rect
- func (p *PlayerImpl) GetRight() float32
- func (p *PlayerImpl) GetSize() float32
- func (p *PlayerImpl) GetTop() float32
- func (p *PlayerImpl) IsEnable() bool
- func (p *PlayerImpl) Move(dx float32, dy float32)
- func (p *PlayerImpl) SetCurrentInputNumber(curNumber int32)
- func (p *PlayerImpl) SetEnable(enable bool)
- func (p *PlayerImpl) SetHealth(health float32)
- func (p *PlayerImpl) SetPosition(point common.Point)
- func (p *PlayerImpl) Shoot(x float32, y float32, dx float32, dy float32)
- type Position
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player interface { Move(dx float32, dy float32) Shoot(x float32, y float32, dx float32, dy float32) GetPlayerProto() *Message_proto.Player GetPosition() common.Point SetPosition(common.Point) GetName() string GetID() int32 GetClientID() int32 GetNextReload() time.Time SetHealth(health float32) GetHealth() float32 AddScore() IsEnable() bool SetEnable(enable bool) // Box interface GetTop() float32 GetBottom() float32 GetLeft() float32 GetRight() float32 // Client related Data SetCurrentInputNumber(int32) // Body interface GetCircle() shape.Circle }
type PlayerImpl ¶
type PlayerImpl struct {
// contains filtered or unexported fields
}
func (*PlayerImpl) AddScore ¶
func (p *PlayerImpl) AddScore()
AddScore add score of player by 1. It is called when user killed an enemy
func (*PlayerImpl) GetBottom ¶
func (p *PlayerImpl) GetBottom() float32
func (*PlayerImpl) GetCircle ¶
func (p *PlayerImpl) GetCircle() shape.Circle
func (*PlayerImpl) GetNextReload ¶
func (p *PlayerImpl) GetNextReload() time.Time
GetNextReload gets the next allowed shoot time.
func (*PlayerImpl) GetPlayerProto ¶
func (p *PlayerImpl) GetPlayerProto() *Message_proto.Player
GetPlayerProto returns player proto
func (*PlayerImpl) GetRect ¶
func (p *PlayerImpl) GetRect() shape.Rect
GetRect returns a boundary rectangle of player
func (*PlayerImpl) GetRight ¶
func (p *PlayerImpl) GetRight() float32
func (*PlayerImpl) GetSize ¶
func (p *PlayerImpl) GetSize() float32
func (*PlayerImpl) GetTop ¶
func (p *PlayerImpl) GetTop() float32
func (*PlayerImpl) IsEnable ¶
func (p *PlayerImpl) IsEnable() bool
func (*PlayerImpl) Move ¶
func (p *PlayerImpl) Move(dx float32, dy float32)
Move in dx and dy, dx and dy have to be calculated according to timeElapsed beforehand
func (*PlayerImpl) SetCurrentInputNumber ¶
func (p *PlayerImpl) SetCurrentInputNumber(curNumber int32)
func (*PlayerImpl) SetEnable ¶
func (p *PlayerImpl) SetEnable(enable bool)
func (*PlayerImpl) SetHealth ¶
func (p *PlayerImpl) SetHealth(health float32)
func (*PlayerImpl) SetPosition ¶
func (p *PlayerImpl) SetPosition(point common.Point)
SetPosition ...
Click to show internal directories.
Click to hide internal directories.