tank

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Up int = iota
	Down
	Left
	Right
)

Variables

View Source
var GlobalTanks = make(map[int]*Tank)
View Source
var TankIndex = 0

Functions

func Draw

func Draw(screen *ebiten.Image)

func Update

func Update()

Types

type Position

type Position struct {
	X int
	Y int
}

func TankBorn

func TankBorn(dx, dy int) Position

type Tank

type Tank struct {
	Hp        int
	Collider  *collision.Collider
	Direction direction.Direction

	Image  image.Image
	Attack bool
	Move   bool
	Camp   string
	Index  int
	// contains filtered or unexported fields
}

func New

func New(camp string, tankx int, tanky int) *Tank

func (*Tank) BulletIsPassable

func (t *Tank) BulletIsPassable() bool

func (*Tank) Draw

func (t *Tank) Draw(screen *ebiten.Image)

func (*Tank) Fight

func (t *Tank) Fight()

func (*Tank) GetCamp

func (t *Tank) GetCamp() string

func (*Tank) SetPosition

func (t *Tank) SetPosition(position Position)

func (*Tank) TakeDamage

func (t *Tank) TakeDamage(damage int)

func (*Tank) TankIsPassable

func (t *Tank) TankIsPassable() bool

func (*Tank) Update

func (t *Tank) Update(direction direction.Direction)

Jump to

Keyboard shortcuts

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