mirror of
https://github.com/Fluffy-Bean/ColouringApp.git
synced 2025-01-29 15:48:27 +00:00
I actually just forgotten
This commit is contained in:
parent
1b05e0364b
commit
9225fd428a
|
@ -8,11 +8,17 @@ const (
|
|||
)
|
||||
|
||||
const (
|
||||
SceneTitle = iota
|
||||
ScenePlayerData = iota
|
||||
SceneTitle
|
||||
SceneOptions
|
||||
SceneGame
|
||||
)
|
||||
|
||||
var CurrentScene = SceneTitle
|
||||
const (
|
||||
DirAssets = "./assets/"
|
||||
DirPlayerData = "./playerData/"
|
||||
)
|
||||
|
||||
var CurrentScene = ScenePlayerData
|
||||
|
||||
var ShouldQuit = false
|
||||
|
|
BIN
assets/Map.png
Normal file
BIN
assets/Map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
2
main.go
2
main.go
|
@ -16,6 +16,8 @@ func main() {
|
|||
// MAIN LOOP
|
||||
for !application.ShouldQuit {
|
||||
switch application.CurrentScene {
|
||||
case application.ScenePlayerData:
|
||||
scenes.PlayerData()
|
||||
case application.SceneTitle:
|
||||
scenes.Title()
|
||||
case application.SceneOptions:
|
||||
|
|
|
@ -3,6 +3,7 @@ package scenes
|
|||
import (
|
||||
"ColouringApp/application"
|
||||
"fmt"
|
||||
|
||||
gui "github.com/gen2brain/raylib-go/raygui"
|
||||
raylib "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
|
29
scenes/playerData.go
Normal file
29
scenes/playerData.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package scenes
|
||||
|
||||
import (
|
||||
"ColouringApp/application"
|
||||
"time"
|
||||
|
||||
raylib "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
func PlayerData() {
|
||||
// Load player data here
|
||||
for !application.ShouldQuit {
|
||||
application.ShouldQuit = raylib.WindowShouldClose()
|
||||
if application.CurrentScene != application.ScenePlayerData {
|
||||
break
|
||||
}
|
||||
|
||||
raylib.BeginDrawing()
|
||||
raylib.ClearBackground(raylib.Black)
|
||||
|
||||
raylib.DrawText("Loading...", 10, application.WindowHeight-30, 20, raylib.White)
|
||||
|
||||
raylib.EndDrawing()
|
||||
|
||||
// Just a placeholder
|
||||
time.Sleep(1 * time.Second)
|
||||
application.CurrentScene = application.SceneTitle
|
||||
}
|
||||
}
|
|
@ -9,10 +9,12 @@ import (
|
|||
|
||||
func Title() {
|
||||
var (
|
||||
titleText = "Example Game"
|
||||
)
|
||||
titleText = application.WindowTitle
|
||||
mapImage = raylib.LoadTexture(application.DirAssets + "Map.png")
|
||||
|
||||
// load resources here
|
||||
mapX = 0
|
||||
mapY = 0
|
||||
)
|
||||
|
||||
for !application.ShouldQuit {
|
||||
application.ShouldQuit = raylib.WindowShouldClose()
|
||||
|
@ -36,8 +38,26 @@ func Title() {
|
|||
application.ShouldQuit = true
|
||||
}
|
||||
|
||||
// Map thing?
|
||||
raylib.DrawRectangleLines(120, 39, application.WindowWidth-130, application.WindowHeight-49, raylib.White)
|
||||
raylib.BeginScissorMode(121, 40, application.WindowWidth-132, application.WindowHeight-51)
|
||||
|
||||
mapX += 1
|
||||
mapX = 0
|
||||
mapY = 0
|
||||
if mapX > 1920 {
|
||||
mapX = 0
|
||||
}
|
||||
|
||||
mapY += 1
|
||||
if mapY > 1080 {
|
||||
mapY = 0
|
||||
}
|
||||
raylib.DrawTexture(mapImage, int32(-mapX), int32(-mapY), raylib.White)
|
||||
|
||||
raylib.EndScissorMode()
|
||||
raylib.EndDrawing()
|
||||
}
|
||||
|
||||
// unload resources here
|
||||
raylib.UnloadTexture(mapImage)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue