Documentation ¶
Index ¶
Constants ¶
View Source
const (
// PlaneSnapshotSize : uint8 (planeId) + float32 * 3 (location) + float32 * 4 (rotation) + 1 bit for firing + 7 bits damage
PlaneSnapshotSize = 1 + 1 + (3 * 4) + (4 * 4)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bullet ¶
type Bullet struct {
// contains filtered or unexported fields
}
Bullet represent a bullet
type Plane ¶
type Plane struct { UID uint8 // contains filtered or unexported fields }
Plane describe a plane with all its properties
func NewPlane ¶
func NewPlane(uid uint8, model PlaneModel, gun chan<- *Bullet) (plane *Plane)
NewPlane fill the plane with its default properties
func (*Plane) CorrectFromCollision ¶
CorrectFromCollision update the position of the plane if there is a collision with the terrain
type PlaneInput ¶
PlaneInput ...
type PlaneModel ¶
type PlaneModel struct { MaxThrust float64 `json:"maxThrust"` Mass float64 `json:"mass"` MaxRotations mathutils.Vector3D `json:"maxRotations"` // All in radians / seconds DragFactors mathutils.Vector3D `json:"dragFactors"` // A drag factor are "Area * Drag Coeficient * 0.5" of a side LiftMin float64 `json:"liftMin"` LiftMax float64 `json:"liftMax"` DefaultSpeed float64 `json:"defaultSpeed"` // Default speed of the plane on the Z axis Life uint8 `json:"life"` }
PlaneModel are all the constant properties that can easily be loaded from a JSON object
type PlayerInput ¶
PlayerInput contains input data and the uid to which it is attributed
type Terrain ¶
type Terrain struct {
// contains filtered or unexported fields
}
Terrain ...
func LoadTerrain ¶
LoadTerrain loads the terrain
type World ¶
type World struct { Input chan PlayerInput Snapshots chan []byte End chan bool // End the world // contains filtered or unexported fields }
World World is which everything happens
Click to show internal directories.
Click to hide internal directories.