carotidartillery/player.go

36 lines
423 B
Go
Raw Normal View History

2021-10-05 03:47:29 +00:00
package main
import (
"time"
)
type gamePlayer struct {
x, y float64
angle float64
weapon *playerWeapon
2021-10-06 04:05:02 +00:00
2021-10-07 00:29:28 +00:00
score int
soulsRescued int
2021-10-06 04:05:02 +00:00
health int
2021-10-12 03:22:13 +00:00
2021-10-20 01:46:11 +00:00
holyWaters int
garlicUntil time.Time
holyWaterUntil time.Time
2021-10-05 03:47:29 +00:00
}
func NewPlayer() (*gamePlayer, error) {
p := &gamePlayer{
weapon: &playerWeapon{
sprite: imageAtlas[ImageUzi],
2021-10-05 03:47:29 +00:00
cooldown: 100 * time.Millisecond,
},
2021-10-07 01:02:17 +00:00
health: 3,
2021-10-05 03:47:29 +00:00
}
return p, nil
}