Package adventure

Overview ▾

Package adventure provides a graphic adventure (point and click) game template.


Verbs describe the ways players and objects interact with each other and the world. When no specific action is chosen, VerbDefault is used.

type Game

type Game struct {

    Root *world.Scene // TODO

func NewAdventureGame

func NewAdventureGame() *Game

func (*Game) AddObject

func (g *Game) AddObject(object Object)

func (*Game) UpdateGame

func (g *Game) UpdateGame(screen *ebiten.Image) error

type Inventory

type Inventory struct {
    Size  int
    Items []*Item

func (*Inventory) Add

func (i *Inventory) Add(item *Item) bool

func (*Inventory) Contains

func (i *Inventory) Contains(item *Item) bool

type Item

type Item interface {

    // ItemSprite is the sprite displayed when the item is held by the player.
    ItemSprite() *world.Sprite

type Object

type Object interface {

    ObjectName() string
    ObjectType() int

    // WorldSprite is the sprite displayed when this object is not held in the player's inventory.
    WorldSprite() *world.Sprite

type Quest

type Quest struct {
    Discovered  bool
    Title       string
    Description string

func (*Quest) Complete

func (q *Quest) Complete() bool

type Verb

Verb represents an action. Use a negative value when creating custom verbs.

type Verb int
const (
    VerbNone     Verb = 0
    VerbDefault  Verb = 1
    VerbLook     Verb = 2
    VerbInteract Verb = 3