mario_go

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2016 License: MIT Imports: 2 Imported by: 0

README

mario-go

Super Mario Bros. on the command line. Joke app.

logo

Keyboard Action
Move to the right
Move to the left
Jump
Esc or Ctrl+c Exit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dot

type Dot struct {
	X     int
	Y     int
	Color int32
}

func NewDot

func NewDot(x, y int, color int32) *Dot

type Dots

type Dots []Dot

func MakeDots

func MakeDots(indices []int32) Dots

type Drawable

type Drawable interface {
	SetScreen(screen tcell.Screen)
	Dots() Dots
	X() int
	Y() int
	SetX(v int)
	SetY(v int)
	Width() int
	Height() int
}

type Ground added in v0.2.0

type Ground struct {
	Sprite
	// contains filtered or unexported fields
}

func NewGround added in v0.2.0

func NewGround() *Ground

func (Ground) Dots added in v0.2.0

func (s Ground) Dots() Dots

func (Ground) Height added in v0.2.0

func (s Ground) Height() int

func (Ground) Width added in v0.2.0

func (s Ground) Width() int

type Mario

type Mario struct {
	Sprite
	// contains filtered or unexported fields
}

func NewMario

func NewMario() *Mario

func (Mario) Dots

func (s Mario) Dots() Dots

func (*Mario) Fall added in v0.2.0

func (m *Mario) Fall()

func (Mario) Height added in v0.2.0

func (s Mario) Height() int

func (*Mario) Jump

func (m *Mario) Jump()

func (*Mario) Jumping

func (m *Mario) Jumping() bool

func (*Mario) Land added in v0.2.0

func (m *Mario) Land()

func (*Mario) Left

func (m *Mario) Left()

func (*Mario) Move

func (m *Mario) Move()

func (*Mario) Right

func (m *Mario) Right()

func (Mario) Rising added in v0.2.0

func (m Mario) Rising() bool

func (*Mario) StopX added in v0.2.0

func (m *Mario) StopX()

func (*Mario) StopY added in v0.2.0

func (m *Mario) StopY()

func (Mario) Width added in v0.2.0

func (s Mario) Width() int

type Sprite

type Sprite struct {
	// contains filtered or unexported fields
}

func NewSprite

func NewSprite() *Sprite

func (Sprite) Dots

func (s Sprite) Dots() Dots

func (*Sprite) Draw

func (s *Sprite) Draw()

func (*Sprite) SetScreen

func (s *Sprite) SetScreen(screen tcell.Screen)

func (*Sprite) SetX

func (s *Sprite) SetX(v int)

func (*Sprite) SetY

func (s *Sprite) SetY(v int)

func (Sprite) X

func (s Sprite) X() int

func (Sprite) Y

func (s Sprite) Y() int

type World

type World struct {
	Width   int
	Height  int
	CameraX int
	CameraY int
	Mario   *Mario
	// contains filtered or unexported fields
}

func NewWorld

func NewWorld(s tcell.Screen) *World

func (*World) AddObject added in v0.2.0

func (world *World) AddObject(object Drawable)

func (*World) Draw

func (w *World) Draw()

func (World) DrawDots

func (w World) DrawDots(child Drawable)

func (*World) HitTest added in v0.2.0

func (w *World) HitTest()

func (*World) SetMario added in v0.2.0

func (world *World) SetMario(mario *Mario)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL