config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnemyImageWidth is a width of the enemy image.
	EnemyImageWidth = 64

	// TowerImageWidth is a width of the tower image.
	TowerImageWidth = 96

	// ProjectileImageWith is a width of the projectile image.
	ProjectileImageWith = 32

	// PathWidth is a width of the path.
	PathWidth = 64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Enemy

type Enemy struct {
	// Name is a name of the enemy.
	Name string `json:"name"`

	// MaxHealth is a maximal health of the enemy.
	MaxHealth int `json:"max_health"`

	// Damage is a damage of the enemy.
	Damage int `json:"damage"`

	// Vrms is a root mean square speed of the enemy.
	Vrms general.Coord `json:"vrms"`

	// MoneyAward is a money award for killing the enemy.
	MoneyAward int `json:"money_award"`

	// Strengths is a list of strengths of the enemy.
	Strengths []Strength `json:"strengths"`

	// Weaknesses is a list of weaknesses of the enemy.
	Weaknesses []Weakness `json:"weaknesses"`
	// contains filtered or unexported fields
}

Enemy is a config for enemy.

func (*Enemy) Image

func (c *Enemy) Image() *ebiten.Image

Image returns image.

func (*Enemy) InitImage

func (c *Enemy) InitImage() error

InitImage initializes image from the temporary state of the entity.

type EnemySwarm

type EnemySwarm struct {
	// EnemyName is a name of the enemy.
	EnemyName string `json:"enemy_name"`

	// Timeout is the time when the first enemy can be called.
	Timeout general.Frames `json:"timeout"`

	// Interval is time between calls.
	Interval general.Frames `json:"interval"`

	// MaxCalls is a maximal amount of enemies that can be called.
	MaxCalls int `json:"max_calls"`
}

EnemySwarm is a config for enemy swarm.

type GameRule

type GameRule []Wave

GameRule is a config for game rule.

type Level

type Level struct {
	// LevelName is a name of the level.
	LevelName string `json:"level_name"`

	// MapName is a name of the map.
	MapName string `json:"map_name"`

	// GameRule is a config for game rule.
	GameRule GameRule `json:"game_rule"`

	// needed for level numeration
	Order int `json:"-"`
}

Level is a config for level.

type Map

type Map struct {
	// Name is a name of the map.
	Name string `json:"name"`

	// BackgroundColor is a background color of the map.
	BackgroundColor string `json:"background_color"`

	// Path is a path of the map.
	Path []general.Point `json:"path"`
	// contains filtered or unexported fields
}

Map is a config for map.

func (*Map) Image

func (c *Map) Image() *ebiten.Image

Image returns image.

func (*Map) InitImage

func (c *Map) InitImage() error

InitImage initializes image from the temporary state of the entity.

type Projectile

type Projectile struct {
	Name string
	// contains filtered or unexported fields
}

Projectile is a config for projectile.

func (*Projectile) Image

func (c *Projectile) Image() *ebiten.Image

Image returns image.

func (*Projectile) InitImage

func (c *Projectile) InitImage() error

InitImage initializes image from the temporary state of the entity.

type Strength

type Strength struct {
	// T is a type of the strength.
	T general.TypeAttack `json:"type"`

	// DecDmg is a damage decrement of the strength.
	DecDmg int `json:"dec_dmg"`
}

Strength is a config for strength.

type Tower

type Tower struct {
	// Name is a name of the tower.
	Name string `json:"name"`

	// Upgrades is a list of upgrades of the tower.
	Upgrades []Upgrade `json:"upgrades"`

	// Price is a price of the tower.
	Price int `json:"price"`

	// Type is a type of the tower attack.
	Type general.TypeAttack `json:"type"`

	// InitDamage is an initial damage of the tower.
	InitDamage int `json:"initial_damage"`

	// InitRadius is an initial radius of the tower.
	InitRadius general.Coord `json:"initial_radius"`

	// InitSpeedAttack is an initial speed attack of the tower.
	InitSpeedAttack general.Frames `json:"initial_speed_attack"`

	// InitProjectileVrms is an initial projectile vrms of the tower.
	InitProjectileVrms general.Coord `json:"init_projectile_speed"`

	// ProjectileConfig is a config for projectile.
	ProjectileConfig Projectile `json:"projectile_config"`

	// OpenLevel is a level when the tower can be opened.
	OpenLevel int `json:"open_level"`
	// contains filtered or unexported fields
}

Tower is a config for tower.

func (*Tower) Image

func (c *Tower) Image() *ebiten.Image

Image returns image.

func (*Tower) InitImage

func (c *Tower) InitImage() error

InitImage initializes image from the temporary state of the entity.

type UI

type UI struct {
	// Colors contains hex-colors (e.g. "#AB0BA0") for each key in map
	Colors map[string]string `json:"colors"`
}

UI is a config for GlobalUI.

type Upgrade

type Upgrade struct {
	// Price is a price of the upgrade.
	Price int `json:"price"`

	// DeltaDamage is a delta damage of the upgrade.
	DeltaDamage int `json:"delta_damage"`

	// DeltaSpeedAttack is a delta speed attack of the upgrade.
	DeltaSpeedAttack general.Frames `json:"delta_speed_attack"`

	// DeltaRadius is a delta radius of the upgrade.
	DeltaRadius general.Coord `json:"delta_radius"`

	// OpenLevel is a level when the upgrade can be opened.
	OpenLevel int `json:"open_level"`
}

Upgrade is a config for tower's upgrade.

type Wave

type Wave struct {
	Swarms []EnemySwarm `json:"swarms"`
}

Wave is a config for wave.

type Weakness

type Weakness struct {
	// T is a type of the weakness.
	T general.TypeAttack `json:"type"`

	// IncDmg is a damage increment of the weakness.
	IncDmg int `json:"inc_dmg"`
}

Weakness is a config for weakness.

Jump to

Keyboard shortcuts

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