arcade

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package arcade implements data structures used by the Termacade.

Index

Constants

This section is empty.

Variables

View Source
var DefaultFlowerJourneyRules = FlowerJourneyRules{
	WallMin:                  -0.9,
	WallMax:                  1.1,
	WallGapStart:             2.5,
	WallGap100:               2.25,
	FirstWallDist:            5,
	WallDist:                 5,
	CountdownLength:          3,
	CountdownTime:            0.75,
	GoTime:                   1,
	SpeedStart:               0.05,
	Speed100:                 0.1,
	FlapVelocity:             4.5,
	GravityScale:             1.5,
	ScorePerWall:             15,
	ScorePerWallCombo:        0,
	ScorePerPassedEnemy:      30,
	ScorePerPassedEnemyCombo: 0,
	ScorePerKilledEnemy:      10,
	ScorePerKilledEnemyCombo: 10,
	ScorePerFlower:           10,
	ScorePerFlowerCombo:      10,
	HoneyInvulnTime:          5,
	HoneyMinCombo:            8,
	EnemyHeightMin:           1.25,
	EnemyHeightMax:           3.5,
	EnemyMinCombo:            4,
	EnemyMinProgress:         8,
	EnemySpeed:               0.75,
}

DefaultFlowerJourneyRules is the default game rules for Flower Journey.

View Source
var DefaultMiteKnightRules = MiteKnightRules{
	PauseStopsAnimations: false,
	PauseOverview:        false,
	FloorCount:           3,
	MapSize:              [2]float64{25, 25},
	MapSizePerFloor:      [2]float64{5, 5},
	MaxRoomSize:          [2]float64{3, 3},
	WizardMinFloor:       1,
	AntEnemyWeight:       3,
	WizardEnemyWeight:    2,
	DoubleBossMinFloor:   2,
	RoomCount:            8,
	RoomCountPerFloor:    0.25,
	EnemyCount:           8,
	EnemyCountPerFloor:   1,
	TimeLimit:            300,
	PlayerMaxHP:          6,
	CompassDelay:         2,
	ScorePerHit:          10,
	ScorePerKill:         100,
	ScorePerKey:          500,
	ScorePerDoor:         400,
	EnemyDamageImmunity:  1,
	PlayerDamageImmunity: 4.0 / 3.0,
	CamFollowSpeed:       0.1,
	CamRotationSpeed:     0.1,
	ScoreDigits:          5,
}

DefaultMiteKnightRules is the default game rules for Mite Knight.

View Source
var ErrUnknownGame = errors.New("arcade: unknown game")

ErrUnknownGame is returned when an unhandled game ID is used.

Functions

func MarshalRules added in v0.3.19

func MarshalRules(w *format.Writer, v GameRules)

func UnmarshalRules added in v0.3.19

func UnmarshalRules(r *format.Reader, v GameRules)

Types

type ErrRecordingVersion added in v0.3.7

type ErrRecordingVersion uint64

func (ErrRecordingVersion) Error added in v0.3.7

func (err ErrRecordingVersion) Error() string

type FlowerJourneyRules

type FlowerJourneyRules struct {
	WallMin                  float64
	WallMax                  float64
	WallGapStart             float64
	WallGap100               float64
	FirstWallDist            float64
	WallDist                 float64
	CountdownLength          float64
	CountdownTime            float64
	GoTime                   float64
	SpeedStart               float64
	Speed100                 float64
	FlapVelocity             float64
	GravityScale             float64
	ScorePerWall             float64
	ScorePerWallCombo        float64
	ScorePerPassedEnemy      float64
	ScorePerPassedEnemyCombo float64
	ScorePerKilledEnemy      float64
	ScorePerKilledEnemyCombo float64
	ScorePerFlower           float64
	ScorePerFlowerCombo      float64
	HoneyInvulnTime          float64
	HoneyMinCombo            float64
	EnemyHeightMin           float64
	EnemyHeightMax           float64
	EnemyMinCombo            float64
	EnemyMinProgress         float64
	EnemySpeed               float64
}

FlowerJourneyRules is GameRules for Flower Journey.

func (*FlowerJourneyRules) Default

func (r *FlowerJourneyRules) Default() GameRules

Default implements GameRules.

type Game

type Game uint8

Game is a Termacade game.

const (
	MiteKnight    Game = 1
	FlowerJourney Game = 2
)

Constants for Game.

func (Game) String

func (i Game) String() string

type GameRules

type GameRules interface {
	Default() GameRules
}

GameRules is an interface implemented by all game rules.

type HighScoresMode added in v0.3.16

type HighScoresMode uint8

HighScoresMode is a high scores filtering mode.

const (
	Recent    HighScoresMode = 'r'
	Weekly    HighScoresMode = 'w'
	Quarterly HighScoresMode = 'q'
	AllTime   HighScoresMode = 'a'
)

Constants for Mode.

func (HighScoresMode) String added in v0.3.16

func (i HighScoresMode) String() string

type MiteKnightRules

type MiteKnightRules struct {
	PauseStopsAnimations bool
	PauseOverview        bool
	FloorCount           float64
	MapSize              [2]float64
	MapSizePerFloor      [2]float64
	MaxRoomSize          [2]float64
	WizardMinFloor       float64
	AntEnemyWeight       float64
	WizardEnemyWeight    float64
	DoubleBossMinFloor   float64
	RoomCount            float64
	RoomCountPerFloor    float64
	EnemyCount           float64
	EnemyCountPerFloor   float64
	TimeLimit            float64
	PlayerMaxHP          float64
	CompassDelay         float64
	ScorePerHit          float64
	ScorePerKill         float64
	ScorePerKey          float64
	ScorePerDoor         float64
	EnemyDamageImmunity  float64
	PlayerDamageImmunity float64
	CamFollowSpeed       float64
	CamRotationSpeed     float64
	ScoreDigits          float64
}

MiteKnightRules is GameRules for Mite Knight.

func (*MiteKnightRules) Default

func (r *MiteKnightRules) Default() GameRules

Default implements GameRules.

type RecordedInput

type RecordedInput struct {
	Buttons         []input.Button
	AdditionalTicks uint64
}

RecordedInput is one set of held buttons during a Termacade recording. The Buttons are held for 1+AdditionalTicks sixtieths of a second.

type Recording

type Recording struct {
	Version        [3]uint64
	Game           Game
	Rules          GameRules
	Seed           string
	Start          time.Time
	Inputs         []RecordedInput
	FinalRandCount uint64
	PlayerName     string
}

Recording is a record of the buttons pressed in a Termacade game.

func (*Recording) MarshalBinary

func (rec *Recording) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*Recording) UnmarshalBinary

func (rec *Recording) UnmarshalBinary(b []byte) (err error)

UnmarshalBinary implements encoding.BinaryUnmarshaler.

Directories

Path Synopsis
Package flowerjourney implements the Termacade game Flower Journey.
Package flowerjourney implements the Termacade game Flower Journey.
Package game holds the shared code for Termacade games.
Package game holds the shared code for Termacade games.
Package highscores implements the Termacade high scores viewer.
Package highscores implements the Termacade high scores viewer.
Package mainmenu handles the Termacade main menu.
Package mainmenu handles the Termacade main menu.
Package miteknight implements the Termacade game Mite Knight.
Package miteknight implements the Termacade game Mite Knight.
Package touchcontroller implements a touch screen-based gamepad.
Package touchcontroller implements a touch screen-based gamepad.

Jump to

Keyboard shortcuts

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