globals

package
v0.0.0-...-156f350 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TileSize = 16
	TilesetW = 16

	ScreenWidth  = (36 + 10) * TileSize
	ScreenHeight = (24 + 10) * TileSize

	TilesW      = ScreenWidth / TileSize
	TilesH      = (ScreenHeight / TileSize) - 2
	TilesT      = TilesW * TilesH
	TilesBottom = TilesT - TilesW

	TPS         = 30
	CycleLength = TPS * 8
)

Game globals.

Variables

View Source
var (
	DEBUG       = false
	GAME_PAUSED = false
	ESC_MENU    = false
)

Functions

func Delay

func Delay(f func())

Sleep 100ms.

func Dist

func Dist(ax, ay, bx, by int) float64

func DrawOptions

func DrawOptions(idx int, alpha, rotation float64) *ebiten.DrawImageOptions

func DrawTile

func DrawTile(sprite int, screen *ebiten.Image, tileset *ebiten.Image, alpha float64, op *ebiten.DrawImageOptions)

func GenerateTodos

func GenerateTodos()

Each TODO must be in the following format:

/////////
// TODO
// [non-empty description]
/////////

Where the start and end slashes must be four or more in length.

func IdxToX

func IdxToX(idx int) int

IdxToX returns the corresponding X value to for given index.

func IdxToXY

func IdxToXY(idx int) (int, int)

IdxToXY returns the corresponding X and Y values for a given index.

func IdxToY

func IdxToY(idx int) int

IdxToY returns the corresponding Y value to for given index.

func XYToIdx

func XYToIdx(x, y int) int

XYToIdx returns the corresponding index based on the given X and Y values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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