gamedata

package
v0.0.0-...-0be9988 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NumTankSpriteFrames = 64
	TankFrameAngleStep  = gmath.Rad((2 * math.Pi) / float64(NumTankSpriteFrames))

	CellSize        = 40
	NumSegmentCells = 96

	MaxGroupSize = 8

	ConstructorEnergyCost = 60
	CommanderEnergyCost   = 80
)

Variables

View Source
var AssaultLaserStats = FinalizeTurretStats(&TurretStats{
	ProductionTime:      12,
	AttackSound:         assets.AudioShotAssaultLaser1,
	HP:                  10,
	RotationSpeed:       2.0,
	Range:               7 * CellSize,
	Accuracy:            0.8,
	MaxAngleDelta:       0.05,
	ImpactArea:          8,
	ProjectileImage:     assets.ImageProjectileAssaultLaser,
	ProjectileExplosion: ExplosionAssaultLaser,
	ProjectileSpeed:     350,
	Reload:              0.5,
	MaxTargets:          1,
	BurstSize:           1,
	Damage:              DamageValue{Health: 3},
	BodySpeedMultiplier: 1.0,
})
View Source
var BunkerBodyStats = &BodyStats{
	TurretOffset: -5,
	Size:         unitSizeBig,
	HP:           100,
	Image:        assets.ImageTowerBodyBunker,
}
View Source
var CommanderUnitStats = &UnitStats{
	Movement: UnitMovementHover,
	Body: &BodyStats{
		HP:    30,
		Speed: 40,
		Image: assets.ImageDroneCommander,
		Size:  unitSizeSmall,
	},
	Selectable: true,
}
View Source
var ConstructorUnitStats = &UnitStats{
	Movement: UnitMovementHover,
	Body: &BodyStats{
		HP:    20,
		Speed: 50,
		Image: assets.ImageDroneConstructor,
		Size:  unitSizeSmall,
	},
	Selectable: true,
}
View Source
var CreepBunkerBodyStats = &BodyStats{
	TurretOffset: -1,
	Size:         unitSizeBig,
	HP:           100,
	Image:        assets.ImageTowerBodyCreepBunker,
}
View Source
var CreepHeavyBodyStats = &BodyStats{
	ProductionTime: 40,
	TurretOffset:   -1,
	Size:           unitSizeBig,
	HP:             140,
	RotationSpeed:  1.2,
	Speed:          40,
	Heavy:          true,
}
View Source
var CreepTankFactoryUnitStats = &UnitStats{
	Movement: UnitMovementNone,
	Body: &BodyStats{
		HP:    175,
		Image: assets.ImageCreepTankFactory,
		Size:  unitSizeVeryBig,
	},
	Creep: true,
}
View Source
var DestroyerBodyStats = &BodyStats{
	ProductionTime: 30,
	TurretOffset:   -1,
	Size:           unitSizeBig,
	HP:             120,
	RotationSpeed:  1,
	Speed:          50,
	Heavy:          true,
}
View Source
var FighterBodyStats = &BodyStats{
	ProductionTime: 10,
	TurretOffset:   -1,
	Size:           unitSizeMedium,
	HP:             35,
	RotationSpeed:  2.0,
	Speed:          80,
}
View Source
var GatlingStats = FinalizeTurretStats(&TurretStats{
	ProductionTime:      5,
	AttackSound:         assets.AudioShotGatling,
	HP:                  10,
	RotationSpeed:       1.2,
	Range:               7 * CellSize,
	Accuracy:            0.5,
	MaxAngleDelta:       0.1,
	ImpactArea:          4,
	ProjectileImage:     assets.ImageProjectileGatling,
	ProjectileSpeed:     400,
	Reload:              2.0,
	MaxTargets:          1,
	BurstSize:           3,
	BurstDelay:          0.1,
	Damage:              DamageValue{Health: 1},
	BodySpeedMultiplier: 1.0,
})
View Source
var GeneratorUnitStats = &UnitStats{
	Movement: UnitMovementNone,
	Body: &BodyStats{
		HP:    70,
		Image: assets.ImageGenerator,
		Size:  unitSizeMedium,
	},
	Selectable:         true,
	ConstructorsNeeded: 1,
	ConstructionTime:   15,
}
View Source
var HeavyTankFactoryUnitStats = &UnitStats{
	Movement: UnitMovementNone,
	Body: &BodyStats{
		HP:    300,
		Image: assets.ImageHeavyTankFactory,
		Size:  unitSizeVeryBig,
	},
	Selectable:         true,
	Large:              true,
	ConstructorsNeeded: 3,
	ConstructionTime:   60,
}
View Source
var HunterBodyStats = &BodyStats{
	ProductionTime: 14,
	TurretOffset:   -1,
	Size:           unitSizeBig,
	HP:             40,
	RotationSpeed:  1.6,
	Speed:          110,
	Heavy:          true,
}
View Source
var HurricaneStats = FinalizeTurretStats(&TurretStats{
	ProductionTime:      20,
	AttackSound:         assets.AudioShotHurricane1,
	HP:                  0,
	RotationSpeed:       2.0,
	Range:               15 * CellSize,
	Accuracy:            0.65,
	MaxAngleDelta:       0.15,
	ImpactArea:          14,
	ProjectileImage:     assets.ImageProjectileSmallMissile,
	ProjectileExplosion: ExplosionNormal,
	ProjectileSpeed:     240,
	Reload:              4.25,
	MaxTargets:          5,
	BurstSize:           1,
	ArcPower:            2.5,
	Damage:              DamageValue{Health: 6},
	BodySpeedMultiplier: 0.8,
})
View Source
var LightCannonStats = FinalizeTurretStats(&TurretStats{
	ProductionTime:      5,
	AttackSound:         assets.AudioShotLightCannon1,
	HP:                  10,
	RotationSpeed:       2.0,
	Range:               9 * CellSize,
	Accuracy:            0.8,
	MaxAngleDelta:       0.05,
	ImpactArea:          8,
	ProjectileImage:     assets.ImageProjectileLightCannon,
	ProjectileExplosion: ExplosionNormal,
	ProjectileSpeed:     250,
	Reload:              1.5,
	MaxTargets:          1,
	BurstSize:           1,
	Damage:              DamageValue{Health: 6},
	BodySpeedMultiplier: 0.7,
})
View Source
var MCVBodyStats = &BodyStats{
	Size:          unitSizeBig,
	HP:            250,
	RotationSpeed: 0.8,
	Speed:         30,
	Heavy:         true,
}
View Source
var MCVUnitStats = &UnitStats{
	Movement:   UnitMovementGround,
	Body:       MCVBodyStats,
	Selectable: true,
	Large:      true,
}
View Source
var NormalBodyStats = &BodyStats{
	ProductionTime: 13,
	TurretOffset:   -1,
	Size:           unitSizeMedium,
	HP:             30,
	RotationSpeed:  1.5,
	Speed:          85,
}
View Source
var RepairDepotUnitStats = &UnitStats{
	Movement: UnitMovementNone,
	Body: &BodyStats{
		HP:    100,
		Image: assets.ImageRepairDepot,
		Size:  unitSizeMedium,
	},
	Selectable:         true,
	ConstructorsNeeded: 2,
	ConstructionTime:   25,
}
View Source
var ScatterCannonStats = FinalizeTurretStats(&TurretStats{
	AttackSound:         assets.AudioShotLightCannon1,
	HP:                  25,
	RotationSpeed:       1.8,
	Range:               8 * CellSize,
	Accuracy:            0.75,
	MaxAngleDelta:       0.075,
	ImpactArea:          10,
	ProjectileImage:     assets.ImageProjectileLightCannon,
	ProjectileExplosion: ExplosionNormal,
	ProjectileSpeed:     250,
	Reload:              2.6,
	MaxTargets:          4,
	BurstSize:           1,
	Damage:              DamageValue{Health: 4},
	BodySpeedMultiplier: 0.6,
})
View Source
var ScoutBodyStats = &BodyStats{
	ProductionTime: 5,
	TurretOffset:   -1,
	Size:           unitSizeSmall,
	HP:             20,
	RotationSpeed:  1.8,
	Speed:          100,
}
View Source
var TankFactoryUnitStats = &UnitStats{
	Movement: UnitMovementNone,
	Body: &BodyStats{
		HP:    200,
		Image: assets.ImageTankFactory,
		Size:  unitSizeVeryBig,
	},
	Selectable:         true,
	Large:              true,
	ConstructorsNeeded: 2,
	ConstructionTime:   30,
}
View Source
var TowerConstruction = &UnitStats{
	Movement: UnitMovementNone,
	Body: &BodyStats{
		HP:    30,
		Image: assets.ImageTowerBodyBunker,
		Size:  unitSizeBig,
	},
	Selectable:         true,
	ConstructorsNeeded: 1,
}
View Source
var WheelsBodyStats = &BodyStats{
	ProductionTime: 3,
	TurretOffset:   -1,
	Size:           unitSizeSmall,
	HP:             5,
	RotationSpeed:  1.0,
	Speed:          140,
}

Functions

This section is empty.

Types

type BattleConfig

type BattleConfig struct {
	PlayerInput *input.Handler

	PlayerDesigns *PlayerDesigns

	GameSpeed int
}

type BodyStats

type BodyStats struct {
	Texture resource.Image
	Image   resource.ImageID

	ProductionTime float64

	TurretOffset float64

	Speed         float64
	RotationSpeed gmath.Rad

	Size gmath.Vec

	Heavy bool

	HP float64
}

type DamageValue

type DamageValue struct {
	Health float64
}

type PlayerDesigns

type PlayerDesigns struct {
	Towers []*UnitStats
	Tanks  []*UnitStats

	// [0] generator
	// [1] turret 1
	// [2] turret 2
	// [3] repair depot
	// [4] factory 1
	// [5] factory 2
	// [6] factory 3
	// [7] factory 4
	Icons []*ebiten.Image

	IconConstructor *ebiten.Image
	IconCommander   *ebiten.Image
}

func NewPlayerDesigns

func NewPlayerDesigns() *PlayerDesigns

type ProjectileExplosionKind

type ProjectileExplosionKind int
const (
	ExplosionNone ProjectileExplosionKind = iota
	ExplosionNormal
	ExplosionAssaultLaser
)

type TurretStats

type TurretStats struct {
	Texture resource.Image

	ProductionTime float64

	ProjectileImage          resource.ImageID
	ProjectileSpeed          float64
	ProjectileRotateSpeed    float64
	ProjectilePlaysSound     bool
	ProjectileIsRound        bool
	ProjectileAlwaysExplodes bool
	ImpactArea               float64
	ImpactAreaSqr            float64
	ProjectileExplosion      ProjectileExplosionKind
	AttackSound              resource.AudioID

	BurstSize  int
	BurstDelay float64
	MaxTargets int

	Reload float64

	HP float64

	RotationSpeed gmath.Rad

	BodySpeedMultiplier float64

	Range         float64
	RangeSqr      float64
	TargetLockSqr float64

	Damage DamageValue

	FireOffset    gmath.Vec
	ArcPower      float64
	Accuracy      float64
	MaxAngleDelta gmath.Rad
}

func FinalizeTurretStats

func FinalizeTurretStats(stats *TurretStats) *TurretStats

type UnitMovementKind

type UnitMovementKind int
const (
	UnitMovementGround UnitMovementKind = iota
	UnitMovementHover
	UnitMovementNone
)

type UnitStats

type UnitStats struct {
	Movement UnitMovementKind

	Body   *BodyStats
	Turret *TurretStats

	Selectable bool
	Large      bool
	Creep      bool

	ConstructorsNeeded int
	ConstructionTime   float64
}

Jump to

Keyboard shortcuts

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