starter repo
This commit is contained in:
19
internal/gamelogic/pause.go
Normal file
19
internal/gamelogic/pause.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package gamelogic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bootdotdev/learn-pub-sub-starter/internal/routing"
|
||||
)
|
||||
|
||||
func (gs *GameState) HandlePause(ps routing.PlayingState) {
|
||||
defer fmt.Println("------------------------")
|
||||
fmt.Println()
|
||||
if ps.IsPaused {
|
||||
fmt.Println("==== Pause Detected ====")
|
||||
gs.pauseGame()
|
||||
} else {
|
||||
fmt.Println("==== Resume Detected ====")
|
||||
gs.resumeGame()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user