Added new enemy character. WIP.

This commit is contained in:
2024-11-13 07:44:56 -05:00
parent 8a1194eca3
commit 478ba994d6
6 changed files with 367 additions and 34 deletions

View File

@@ -6,6 +6,7 @@ import (
"mover/assets"
"mover/fonts"
"mover/gamedata"
"mover/touch"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/audio"
@@ -38,8 +39,20 @@ func NewStartScreen() *StartScreen {
func (s *StartScreen) Update() error {
touch.UpdateTouchIDs()
ids := touch.GetTouchIDs()
var touched bool = false
for _, id := range ids {
touched = touch.IsTouchJustPressed(id)
if touched {
break
}
}
if inpututil.IsKeyJustPressed(ebiten.KeyEnter) ||
ebiten.IsStandardGamepadButtonPressed(0, ebiten.StandardGamepadButtonCenterRight) {
ebiten.IsStandardGamepadButtonPressed(0, ebiten.StandardGamepadButtonCenterRight) ||
touched {
s.eHandler[EventCompleted]()
if s.audioplayer.IsPlaying() {
s.audioplayer.Close()