robo

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 9 Imported by: 0

README

robo

How to use

package main

import (
	"os"

	"github.com/tenntenn/robo"
)

func main() { os.Exit(robo.Main(run)) }

func run(r *robo.Robo) {
	r.R()
	r.R()

	r.S()
	r.S()

	r.U()
	r.U()
}

いらすとや has the copyright of images under the img directory.

Documentation

Index

Constants

View Source
const (
	ExitOK    = 0
	ExitError = 1
)

Variables

View Source
var (
	ScreenWidth   = 512
	ScreenHeight  = 512
	FramesPerStep = 30
)

Functions

func Main

func Main(run func(r *Robo)) int

func Run

func Run(run func(r *Robo)) error

Types

type Game

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

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)

func (*Game) Update

func (g *Game) Update() error

type Robo

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

func NewRobo

func NewRobo(game *Game, framesPerStep int) (*Robo, error)

func (*Robo) D

func (r *Robo) D()

func (*Robo) Draw

func (r *Robo) Draw(screen *ebiten.Image)

func (*Robo) L

func (r *Robo) L()

func (*Robo) MoveDown

func (r *Robo) MoveDown()

func (*Robo) MoveLeft

func (r *Robo) MoveLeft()

func (*Robo) MoveRight

func (r *Robo) MoveRight()

func (*Robo) MoveUp

func (r *Robo) MoveUp()

func (*Robo) R

func (r *Robo) R()

func (*Robo) S

func (r *Robo) S()

func (*Robo) Sleep

func (r *Robo) Sleep(steps int)

func (*Robo) U

func (r *Robo) U()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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