Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractObject ¶
type AbstractObject struct { IAbstractObject Id int Location Vector Width float64 Height float64 Velocity Vector Acceleration Vector Gravity Vector Mass float64 IsPlatform bool // Platform is an object the player (or some other entity) can stand on Collides bool // Does this collide with other game objects (can they pass through it) }
func NewAbstractObject ¶
func (*AbstractObject) ApplyForce ¶
func (obj *AbstractObject) ApplyForce(force Vector)
func (*AbstractObject) ApplyFriction ¶
func (obj *AbstractObject) ApplyFriction()
func (*AbstractObject) ApplyGravity ¶
func (obj *AbstractObject) ApplyGravity()
func (*AbstractObject) BounceHorizontal ¶
func (obj *AbstractObject) BounceHorizontal()
func (*AbstractObject) BounceVertical ¶
func (obj *AbstractObject) BounceVertical()
type IAbstractObject ¶
type IAbstractObject interface { Draw(ctx *cairo.Context, screen ScreenInfo) Update(objects []*AbstractObject, screen ScreenInfo) HandleKeyPress(keyId uint, state gdk.ModifierType) HandleKeyRelease(keyId uint, state gdk.ModifierType) }
type ScreenInfo ¶
type Vector ¶
type Vector struct {
X, Y float64
}
func VectorDivideByScalar ¶
func VectorMultiplyByScalar ¶
func (Vector) DivideByScalar ¶
func (*Vector) MultiplyByScalar ¶
Click to show internal directories.
Click to hide internal directories.