@@ -2,6 +2,6 @@ package game
import "fmt"
-func GameInit() {
+func GameStart() {
fmt.Println("Game Initialized")
}
@@ -1,5 +1,8 @@
package game
+import "github.com/gdamore/tcell/v3"
+
+// Directions for movement and actions
const (
up = iota
Left
@@ -11,3 +14,20 @@ const (
downright
action
)
+// Styles holds the different styles for the game elements
+type Styles struct {
+ Default tcell.Style
+ ship tcell.Style
+ hit tcell.Style
+ miss tcell.Style
+ sea tcell.Style
+}
+// Game holds the state of the game
+type Game struct {
+ screen tcell.Screen
+ style Styles
+ keypresses chan int
+ score int
@@ -5,5 +5,5 @@ import (
func main() {
- game.GameInit()
+ game.GameStart()