Documentation ¶
Index ¶
- Constants
- Variables
- func Draw(win *pixelgl.Window, canvas *pixelgl.Canvas)
- func Render(win *pixelgl.Window)
- func TransitionTo(o Scene)
- type AnyInputMethod
- type Bullet
- type ControlScheme
- type ControllerInput
- type Controls
- type DestroyableScene
- type InputMethod
- type JoystickAxisInputMethod
- type JoystickButtonInputMethod
- type JoystickControlSchemeFactory
- 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 = 3 * 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 AnyInputMethod ¶ added in v1.6.12
type AnyInputMethod struct {
Methods []InputMethod
}
func (AnyInputMethod) GetInput ¶ added in v1.6.12
func (im AnyInputMethod) GetInput(win *pixelgl.Window) bool
func (AnyInputMethod) String ¶ added in v1.6.12
func (im AnyInputMethod) String() string
type ControlScheme ¶
type ControlScheme struct {
Thrust, Left, Right, Shoot, Boost InputMethod
}
type ControllerInput ¶
type DestroyableScene ¶
type DestroyableScene interface { Scene Destroy() }
type InputMethod ¶
func AnyInput ¶ added in v1.6.12
func AnyInput(methods ...InputMethod) 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 JoystickControlSchemeFactory ¶ added in v1.6.12
type JoystickControlSchemeFactory func(pixelgl.Joystick) ControlScheme
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.