object

package
v0.0.0-...-c728fae Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dialogue = []RecognizableObject{
	RecMap["dialogueBox"],
}

Dialogue is a list of all objects that would indicate dialogue is ocurring

View Source
var Frisk = []RecognizableObject{
	RecMap["friskFrontFace"],
	RecMap["friskSideFace"],
	RecMap["friskBody"],
	RecMap["friskSideBody"],
	RecMap["friskUpperBody"],
	RecMap["friskBack"],
}

Frisk is a list holding all the objects that would be seen on Frisk

View Source
var Hearts = []RecognizableObject{
	RecMap["redHeart"],
	RecMap["greenHeart"],
	RecMap["blueHeart"],
}

Hearts is a list holding all the hearts possible (eg. red, blue, green)

RecMap is map of the above slice indexed by the name attribute

View Source
var RecognizableObjects = []RecognizableObject{

	newSpecs("narratorBox", 574, 139, color.RGBA{0, 0, 0, 255}, -1),

	newSpecs("redHeart", 15, 15, color.RGBA{255, 0, 0, 255}, -1),

	newSpecs("greenHeart", 15, 15, color.RGBA{0, 192, 0, 255}, -1),

	newSpecs("blueHeart", 15, 15, color.RGBA{0, 60, 255, 255}, -1),

	newSpecs("attackGoal", 18, 83, color.RGBA{0, 0, 0, 255}, -1),

	newSpecs("gameOverM", 127, 79, color.RGBA{254, 254, 254, 255}, -1),

	newSpecs("friskFrontFace", 27, 21, color.RGBA{255, 201, 14, 255}, -1),

	newSpecs("friskSideFace", 19, 21, color.RGBA{255, 201, 14, 255}, -1),

	newSpecs("friskBody", 23, 17, color.RGBA{230, 7, 248, 255}, -1),

	newSpecs("friskSideBody", 13, 17, color.RGBA{61, 18, 14, 255}, -1),

	newSpecs("dialogueBox", 577, 151, color.RGBA{0, 0, 0, 255}, 20),

	newSpecs("fightBox", 164, 139, color.RGBA{0, 0, 0, 255}, -1),

	newSpecs("saveBox", 413, 163, color.RGBA{0, 0, 0, 255}, -1),

	newSpecs("friskUpperBody", 35, 49, color.RGBA{255, 201, 14, 255}, -1),

	newSpecs("friskBack", 39, 59, color.RGBA{61, 18, 14, 255}, -1),

	newSpecs("attackPeg", 7, 123, color.RGBA{255, 255, 255, 255}, -1),

	newSpecs("yellowSwitch", 7, 23, color.RGBA{0, 0, 0, 255}, -1),

	newSpecs("dummy", 27, 19, color.RGBA{239, 228, 176, 255}, -1),

	newSpecs("torielFront", 15, 7, color.RGBA{255, 255, 255, 255}, 0),

	newSpecs("torielSide", 7, 7, color.RGBA{86, 86, 211, 255}, -1),

	newSpecs("entrance", 65, 105, color.RGBA{255, 255, 255, 255}, -1),

	newSpecs("battleOption", 107, 39, color.RGBA{0, 0, 0, 255}, -1),
}

RecognizableObjects holds all the possible recognizable objects in the game

Functions

func Map

func Map(recObjects []RecognizableObject) (recMap map[string]RecognizableObject)

Map turns a slice of RecognizableObject into a map that can be searched with the string name

Types

type Object

type Object struct {
	Bounds     image.Rectangle // Rectangle describing the object's dimensions
	ID         int             // Used for debugging to provide a method of describing an object
	Color      color.Color     // The color of the pixel in the center of the object
	Recognized bool
	RecogObj   RecognizedObject // Holds information for the object it is recognized as if it is recognized
}

Object holds information for a detected object found in the window

func NewObject

func NewObject(rect image.Rectangle, id int, color color.Color, recogobj RecognizedObject) Object

NewObject creates new instance of an Object with parameter checking

func (*Object) Check

func (obj *Object) Check() error

Check determines the validity of an object

type RecognizableObject

type RecognizableObject struct {
	Name     string
	Size     image.Point
	Color    color.Color
	Leniance int // How far off the object can be in terms of size. If set to -1, will be default set in params package
}

RecognizableObject determines the specifications for an object to be recognized by

type RecognizedObject

type RecognizedObject struct {
	Parent *Object
	Type   RecognizableObject
}

RecognizedObject represents an object which has been recognized

func NewRecognizedObject

func NewRecognizedObject(parent *Object, Type RecognizableObject) (RecognizedObject, error)

NewRecognizedObject creates a new instance of RecognizedObject safely

Jump to

Keyboard shortcuts

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