Documentation ¶
Index ¶
- Constants
- Variables
- func Draw(win *pixelgl.Window, canvas *pixelgl.Canvas)
- func Render(win *pixelgl.Window)
- func TransitionTo(o Scene)
- type Bullet
- type ControlScheme
- type ControllerInput
- type Controls
- type DestroyableScene
- type InputMethod
- type JoystickAxisInputMethod
- type JoystickButtonInputMethod
- type KeyboardInputMethod
- type LevelScene
- type LevelTitleScene
- type MainscreenScene
- type Player
- type Scene
- type Ship
- type WinScene
Constants ¶
View Source
const ( CollisionTypePlayer = 1 << (iota + 1) CollisionTypeEnemy CollisionTypeWall )
View Source
const BoostDelay = 7 * time.Second
View Source
const LevelTitleDelay = 4 * time.Second
View Source
const MaxPlayers = 2
Variables ¶
View Source
var (
CanvasBounds = pixel.R(-1920/2, -1080/2, 1920/2, 1080/2)
)
View Source
var PlayerColors = []color.Color{colornames.Blue, colornames.Gold}
View Source
var Players []ControlScheme
Functions ¶
func TransitionTo ¶
func TransitionTo(o Scene)
Types ¶
type ControlScheme ¶
type ControlScheme struct {
Thrust, Left, Right, Shoot, Boost InputMethod
}
type ControllerInput ¶
type DestroyableScene ¶
type DestroyableScene interface { Scene Destroy() }
type InputMethod ¶
type JoystickAxisInputMethod ¶
type JoystickAxisInputMethod struct { Joystick pixelgl.Joystick Axis int // Inverse makes GetInput return true when |axis|>threshold && axis < 0. Inverse bool Threshold float64 Alias string }
func (JoystickAxisInputMethod) GetInput ¶
func (im JoystickAxisInputMethod) GetInput(win *pixelgl.Window) bool
func (JoystickAxisInputMethod) String ¶
func (im JoystickAxisInputMethod) String() string
type JoystickButtonInputMethod ¶
func (JoystickButtonInputMethod) GetInput ¶
func (im JoystickButtonInputMethod) GetInput(win *pixelgl.Window) bool
func (JoystickButtonInputMethod) String ¶
func (im JoystickButtonInputMethod) String() string
type KeyboardInputMethod ¶
func (KeyboardInputMethod) GetInput ¶
func (im KeyboardInputMethod) GetInput(win *pixelgl.Window) bool
func (KeyboardInputMethod) String ¶
func (im KeyboardInputMethod) String() string
type LevelScene ¶
type LevelScene struct {
// contains filtered or unexported fields
}
func PlayLevel ¶
func PlayLevel(index int) *LevelScene
func (*LevelScene) Render ¶
func (s *LevelScene) Render(win *pixelgl.Window)
type LevelTitleScene ¶
type LevelTitleScene struct {
// contains filtered or unexported fields
}
func (*LevelTitleScene) Render ¶
func (s *LevelTitleScene) Render(win *pixelgl.Window)
type MainscreenScene ¶
type MainscreenScene struct {
// contains filtered or unexported fields
}
func (*MainscreenScene) Destroy ¶
func (s *MainscreenScene) Destroy()
func (*MainscreenScene) Render ¶
func (s *MainscreenScene) Render(win *pixelgl.Window)
Click to show internal directories.
Click to hide internal directories.