aboutsummaryrefslogtreecommitdiff
path: root/go/game/map.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-15 16:48:09 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:37 +0200
commitcab2152b6090f5edb383dc1fc3410487207e95d1 (patch)
tree0b89fb5484f44ebb7c0d49f7333707a1f9a9979c /go/game/map.go
parenta8cc0c015d1c4814b1f0b285ed5e6985dd8f6772 (diff)
downloadmuhqs-game-cab2152b6090f5edb383dc1fc3410487207e95d1.tar.gz
muhqs-game-cab2152b6090f5edb383dc1fc3410487207e95d1.zip
load assets from muhq.space when using a release build
Diffstat (limited to 'go/game/map.go')
-rw-r--r--go/game/map.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/go/game/map.go b/go/game/map.go
index 9a07e308..48ec8be3 100644
--- a/go/game/map.go
+++ b/go/game/map.go
@@ -13,12 +13,11 @@ import (
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"
+
+ "muhq.space/muhqs-game/go/assets"
)
const (
- PROTOCOL string = "https://"
- // BASE_URL string = "localhost:8000/"
- BASE_URL string = "muhq.space/muhqs-game"
MAP_URL_PART string = "html/build/maps"
DEFAULT_RESOURCE_GAIN int = 5
@@ -195,9 +194,9 @@ func (m *Map) FindFortificationConnections(x int, y int) (connections int, left,
// GetMap creates a new map from the definition retrieved for the map's name.
func GetMap(name string) (*Map, error) {
- url := path.Join(BASE_URL, MAP_URL_PART, name+".yml")
+ url := path.Join(assets.BASE_URL, MAP_URL_PART, name+".yml")
log.Printf("loading map from %s\n", url)
- resp, err := http.Get(PROTOCOL + url)
+ resp, err := http.Get(assets.PROTOCOL + url)
if err != nil {
log.Fatal(err)
}