item

package
v0.0.0-...-8b39f33 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETele    = "E-Tele"
	Uranium  = "Uranium"
	Flippers = "Flippers"
	Scrap    = "Scrap"
)

Variables

View Source
var Bonus = map[string]struct {
	Terrain string
	Scale   float64
}{
	Flippers: {"w", 1.0},
}

Bonus maps each item to it's terrain bonus. A terrain bonus is the scale to set for the given terrain type. If an item is not in this map then it doesn't give a terrain bonus.

Functions

This section is empty.

Types

type Item

type Item struct {
	Name string
	Uses int
}

An Item is something that the player can collect and possibly use.

func New

func New(name string) *Item

New returns a new item of the given name.

func (*Item) Desc

func (it *Item) Desc() string

Desc returns the item's description.

type Treasure

type Treasure struct {
	Item *Item
	Box  geom.Rectangle
}

A Treasure is an Item located somewhere in the world.

func NewTreasure

func NewTreasure(x, y float64, it *Item) *Treasure

NewTreasure returns a new treasure.

Jump to

Keyboard shortcuts

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