Name change
This commit is contained in:
@@ -6,9 +6,9 @@ import (
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
"github.com/hajimehoshi/ebiten/v2/inpututil"
|
||||
|
||||
"github.com/atridad/BigFeelings/internal/save"
|
||||
"github.com/atridad/BigFeelings/internal/screens"
|
||||
"github.com/atridad/BigFeelings/internal/ui/menu"
|
||||
"github.com/atridad/LilGuy/internal/save"
|
||||
"github.com/atridad/LilGuy/internal/screens"
|
||||
"github.com/atridad/LilGuy/internal/ui/menu"
|
||||
)
|
||||
|
||||
// Window and display configuration.
|
||||
@@ -17,7 +17,7 @@ const (
|
||||
ScreenWidth = 960
|
||||
ScreenHeight = 540
|
||||
TargetTPS = 60
|
||||
WindowTitle = "Big Feelings"
|
||||
WindowTitle = "Lil Guy"
|
||||
)
|
||||
|
||||
// Game states define the different screens and modes the game can be in.
|
||||
@@ -87,18 +87,18 @@ func (f *FPSCap) Cycle() {
|
||||
type controls struct {
|
||||
Left bool
|
||||
Right bool
|
||||
Up bool
|
||||
Down bool
|
||||
Jump bool
|
||||
Sprint bool
|
||||
Shoot bool
|
||||
}
|
||||
|
||||
func readControls() controls {
|
||||
return controls{
|
||||
Left: ebiten.IsKeyPressed(ebiten.KeyArrowLeft) || ebiten.IsKeyPressed(ebiten.KeyA),
|
||||
Right: ebiten.IsKeyPressed(ebiten.KeyArrowRight) || ebiten.IsKeyPressed(ebiten.KeyD),
|
||||
Up: ebiten.IsKeyPressed(ebiten.KeyArrowUp) || ebiten.IsKeyPressed(ebiten.KeyW),
|
||||
Down: ebiten.IsKeyPressed(ebiten.KeyArrowDown) || ebiten.IsKeyPressed(ebiten.KeyS),
|
||||
Jump: ebiten.IsKeyPressed(ebiten.KeyArrowUp) || ebiten.IsKeyPressed(ebiten.KeyW) || ebiten.IsKeyPressed(ebiten.KeySpace),
|
||||
Sprint: ebiten.IsKeyPressed(ebiten.KeyShift),
|
||||
Shoot: inpututil.IsKeyJustPressed(ebiten.KeyK),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,14 +311,15 @@ func (g *Game) updatePlaying() error {
|
||||
g.state.gameplayScreen.Update(screens.GameplayInput{
|
||||
Left: input.Left,
|
||||
Right: input.Right,
|
||||
Up: input.Up,
|
||||
Down: input.Down,
|
||||
Jump: input.Jump,
|
||||
Sprint: input.Sprint,
|
||||
Shoot: input.Shoot,
|
||||
}, delta)
|
||||
|
||||
// Periodic auto-save
|
||||
if now.Sub(g.state.lastAutoSave) >= g.state.autoSaveInterval {
|
||||
g.saveGame()
|
||||
g.state.gameplayScreen.ShowSaveNotification()
|
||||
g.state.lastAutoSave = now
|
||||
}
|
||||
|
||||
@@ -343,6 +344,9 @@ func (g *Game) updatePaused() error {
|
||||
case menu.OptionSave:
|
||||
// Save game immediately
|
||||
g.saveGame()
|
||||
g.state.gameplayScreen.ShowSaveNotification()
|
||||
g.state.gameState = statePlaying
|
||||
g.state.lastTick = time.Now()
|
||||
case menu.OptionMainMenu:
|
||||
// Save game before returning to main menu
|
||||
g.saveGame()
|
||||
|
||||
Reference in New Issue
Block a user