player

package
v0.0.0-...-98b1f95 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Player    Data
	Gun1      *ebiten.Image
	Gun2      *ebiten.Image
	BulletImg *ebiten.Image
	Bullets   []Bullet
)

Functions

func Controls

func Controls()

For moving the Player (moves objects instead of Player) Only moves values stored in player package to prevent an import cycle with the enemies package Enemies and Particles are moved in the enemies Update function

func Draw

func Draw(screen *ebiten.Image)

For drawing the player and its animations

func DrawBullets

func DrawBullets(screen *ebiten.Image)

For drawing bullets

func DrawWeapon

func DrawWeapon(screen *ebiten.Image)

For drawing the weapon

func Init

func Init(Space *resolv.Space)

func Shoot

func Shoot(Space *resolv.Space)

For shooting

Types

type Bullet

type Bullet struct {
	Obj  *resolv.Object
	DirX float64
	DirY float64
}

type Data

type Data struct {
	Obj            *resolv.Object
	Speed          float64
	IdleL          *ebiten.Image
	IdleR          *ebiten.Image
	R              []*ebiten.Image
	L              []*ebiten.Image
	IsLeft         bool
	Moving         bool
	MSCool         int
	MoveStage      int
	WeaponCooldown int
	Damage         int
	Health         int
	ImmunityFrames int
}

Jump to

Keyboard shortcuts

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