From 3ba2fc4c34d49a2b85e053f06900eb49b0de805b Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Wed, 14 Jul 2021 20:11:20 +0200 Subject: [PATCH] Fixed editor, created new islands --- Globals.gd | 2 +- islands/pirate_game_island_0.island | 2 +- islands/pirate_game_island_1.island | 2 +- islands/pirate_game_island_2.island | 2 +- islands/pirate_game_island_3.island | 2 +- islands/pirate_game_island_4.island | 2 +- islands/pirate_game_island_5.island | 1 + islands/pirate_game_island_6.island | 1 + islands/pirate_game_island_7.island | 1 + islands/pirate_game_island_8.island | 1 + islands/pirate_game_island_9.island | 1 + project.godot | 1 - scenes/Editor.gd | 28 +++-- scenes/Game.tscn | 171 ++++++++++++++-------------- scenes/World.gd | 9 +- 15 files changed, 122 insertions(+), 104 deletions(-) create mode 100644 islands/pirate_game_island_5.island create mode 100644 islands/pirate_game_island_6.island create mode 100644 islands/pirate_game_island_7.island create mode 100644 islands/pirate_game_island_8.island create mode 100644 islands/pirate_game_island_9.island diff --git a/Globals.gd b/Globals.gd index 353c07e..78dc25d 100644 --- a/Globals.gd +++ b/Globals.gd @@ -13,7 +13,7 @@ var OceanNavGrid = null var IslandNavGrid = null var hex_size = 128 -var debug_nav = false +var debug_nav = true # Called when the node enters the scene tree for the first time. func _ready(): diff --git a/islands/pirate_game_island_0.island b/islands/pirate_game_island_0.island index 137c9ef..a77f8fa 100644 --- a/islands/pirate_game_island_0.island +++ b/islands/pirate_game_island_0.island @@ -1 +1 @@ -{"(-480, 277.128113)":"Sand","(-480, 387.97937)":"Sand","(-384, -443.404968)":"Sand","(-384, -332.553711)":"Sand","(-384, -221.702499)":"Sand","(-384, 221.702499)":"Sand","(-384, 332.553741)":"Grass","(-384, 443.404999)":"Sand","(-288, -498.830627)":"Sand","(-288, -387.97937)":"Grass","(-288, -277.128113)":"Sand","(-288, 166.276871)":"Sand","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Sand","(-192, -554.256226)":"Sand","(-192, -443.404968)":"Sand","(-192, -332.553741)":"Grass","(-192, -221.702484)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Sand","(-192, 110.85125)":"Sand","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Grass","(-192, 443.404999)":"Sand","(-96, -498.830597)":"Sand","(-96, -387.97937)":"Grass","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Grass","(-96, 387.97937)":"Sand","(0, -554.256226)":"Sand","(0, -443.404999)":"Grass","(0, -332.553741)":"Grass","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Grass","(0, 332.553741)":"Grass","(0, 443.404999)":"Sand","(96, -498.830627)":"Sand","(96, -387.97937)":"Grass","(96, -277.128113)":"Grass","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Grass","(96, 277.128113)":"Grass","(96, 387.97937)":"Sand","(192, -554.256226)":"Sand","(192, -443.404999)":"Sand","(192, -332.553741)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Grass","(192, 332.553741)":"Sand","(288, -166.276871)":"Sand","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Sand","(288, 277.128113)":"Sand","(384, -110.85125)":"Sand","(384, 0)":"Sand","(384, 110.851242)":"Sand","(480, 55.425629)":"Sand"} +{"(-288, 55.425621)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Sand","(-192, 110.85125)":"Sand","(-192, 554.256226)":"Sand","(-192, 665.107483)":"Sand","(-96, -166.276871)":"Sand","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Sand","(-96, 277.128113)":"Sand","(-96, 387.97937)":"Sand","(-96, 498.830627)":"Sand","(-96, 609.681824)":"Grass","(-96, 720.533081)":"Sand","(0, -221.702499)":"Sand","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Grass","(0, 332.553741)":"Grass","(0, 443.404999)":"Grass","(0, 554.256226)":"Grass","(0, 665.107483)":"Grass","(0, 775.95874)":"Sand","(96, -166.276871)":"Sand","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Grass","(96, 277.128113)":"Grass","(96, 387.97937)":"Grass","(96, 498.830597)":"Grass","(96, 609.681885)":"Grass","(96, 720.533142)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Sand","(192, 332.553741)":"Sand","(192, 443.404968)":"Sand","(192, 554.256226)":"Grass","(192, 665.107483)":"Grass","(192, 775.95874)":"Sand","(288, -277.128113)":"Sand","(288, -166.276871)":"Sand","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Sand","(288, 498.830627)":"Sand","(288, 609.681885)":"Sand","(288, 720.533142)":"Sand","(384, -110.85125)":"Sand","(384, 0)":"Sand","(384, 110.851242)":"Sand","(480, -55.425613)":"Sand"} diff --git a/islands/pirate_game_island_1.island b/islands/pirate_game_island_1.island index e7a3ea1..e2362b5 100644 --- a/islands/pirate_game_island_1.island +++ b/islands/pirate_game_island_1.island @@ -1 +1 @@ -{"(-480, -55.425629)":"Sand","(-480, 55.425613)":"Sand","(-480, 166.276855)":"Sand","(-384, -110.851242)":"Sand","(-384, 0)":"Grass","(-384, 110.85125)":"Grass","(-384, 221.702499)":"Sand","(-288, -166.276871)":"Sand","(-288, -55.425629)":"Grass","(-288, 55.425621)":"Grass","(-288, 166.276871)":"Sand","(-192, -332.553741)":"Sand","(-192, -221.702484)":"Sand","(-192, -110.85125)":"Grass","(-192, 0)":"Grass","(-192, 110.85125)":"Sand","(-96, -387.97937)":"Sand","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Sand","(-96, 166.276871)":"Sand","(-96, 277.128113)":"Sand","(0, -443.404999)":"Sand","(0, -332.553741)":"Grass","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Sand","(0, 221.702499)":"Sand","(0, 332.553741)":"Sand","(96, -387.97937)":"Sand","(96, -277.128113)":"Grass","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Grass","(96, 277.128113)":"Grass","(96, 387.97937)":"Sand","(192, -443.404999)":"Sand","(192, -332.553741)":"Grass","(192, -221.702499)":"Grass","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Grass","(192, 332.553741)":"Sand","(288, -387.97937)":"Sand","(288, -277.128113)":"Sand","(288, -166.276871)":"Sand","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Grass","(288, 277.128113)":"Sand","(384, -110.85125)":"Sand","(384, 0)":"Sand","(384, 110.851242)":"Sand","(384, 221.702499)":"Sand","(480, 55.425629)":"Sand"} +{"(-480, -55.425629)":"Sand","(-480, 55.425613)":"Sand","(-480, 166.276855)":"Sand","(-480, 498.830627)":"Sand","(-384, -110.851242)":"Sand","(-384, 0)":"Grass","(-384, 110.85125)":"Grass","(-384, 221.702499)":"Sand","(-384, 332.553741)":"Sand","(-384, 443.404999)":"Sand","(-384, 554.256226)":"Sand","(-288, -55.425629)":"Sand","(-288, 55.425621)":"Grass","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Grass","(-288, 498.830627)":"Grass","(-288, 609.681885)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Grass","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Grass","(-192, 443.404999)":"Grass","(-192, 554.256226)":"Sand","(-96, -55.425625)":"Sand","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Grass","(-96, 387.97937)":"Grass","(-96, 498.830627)":"Sand","(0, 110.85125)":"Sand","(0, 221.702499)":"Grass","(0, 332.553741)":"Grass","(0, 443.404999)":"Sand","(96, 166.276871)":"Sand","(96, 277.128113)":"Grass","(96, 387.97937)":"Sand","(192, 110.85125)":"Sand","(192, 221.702484)":"Grass","(192, 332.553741)":"Sand","(288, 166.276871)":"Sand","(288, 277.128113)":"Grass","(288, 387.97937)":"Sand","(384, 110.851242)":"Sand","(384, 221.702499)":"Grass","(384, 332.553711)":"Sand","(480, -55.425613)":"Sand","(480, 55.425629)":"Sand","(480, 166.276886)":"Grass","(480, 277.128113)":"Grass","(480, 387.97937)":"Sand","(576, 0)":"Sand","(576, 110.851257)":"Sand","(576, 221.702484)":"Sand","(576, 332.553741)":"Sand"} diff --git a/islands/pirate_game_island_2.island b/islands/pirate_game_island_2.island index 6e70e5c..8e9db8c 100644 --- a/islands/pirate_game_island_2.island +++ b/islands/pirate_game_island_2.island @@ -1 +1 @@ -{"(-672, 387.97937)":"Sand","(-672, 498.830627)":"Sand","(-576, 221.702484)":"Sand","(-576, 332.553741)":"Sand","(-576, 443.404999)":"Sand","(-480, 166.276855)":"Sand","(-480, 277.128113)":"Sand","(-480, 387.97937)":"Grass","(-480, 498.830627)":"Sand","(-384, 110.85125)":"Sand","(-384, 221.702499)":"Grass","(-384, 332.553741)":"Grass","(-384, 443.404999)":"Grass","(-384, 554.256226)":"Sand","(-288, -277.128113)":"Sand","(-288, -166.276871)":"Sand","(-288, -55.425629)":"Sand","(-288, 55.425621)":"Sand","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Grass","(-288, 498.830627)":"Sand","(-192, -332.553741)":"Sand","(-192, -221.702484)":"Grass","(-192, -110.85125)":"Grass","(-192, 0)":"Grass","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Grass","(-192, 443.404999)":"Sand","(-96, -387.97937)":"Sand","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Sand","(-96, 387.97937)":"Sand","(-96, 498.830627)":"Sand","(-96, 609.681824)":"Sand","(0, -332.553741)":"Sand","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Sand","(0, 332.553741)":"Sand","(0, 443.404999)":"Sand","(0, 554.256226)":"Grass","(0, 665.107483)":"Sand","(0, 775.95874)":"Sand","(96, -277.128113)":"Sand","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Sand","(96, 277.128113)":"Sand","(96, 387.97937)":"Sand","(96, 498.830597)":"Grass","(96, 609.681885)":"Grass","(96, 720.533142)":"Grass","(96, 831.384399)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Grass","(192, 0)":"Sand","(192, 110.85125)":"Sand","(192, 443.404968)":"Sand","(192, 554.256226)":"Grass","(192, 665.107483)":"Grass","(192, 775.95874)":"Grass","(192, 886.809998)":"Sand","(288, -166.276871)":"Sand","(288, -55.425621)":"Sand","(288, 387.97937)":"Sand","(288, 498.830627)":"Grass","(288, 609.681885)":"Grass","(288, 720.533142)":"Grass","(288, 831.384399)":"Sand","(384, 443.404968)":"Sand","(384, 554.256226)":"Grass","(384, 665.107483)":"Grass","(384, 775.95874)":"Sand","(480, 387.97937)":"Sand","(480, 498.830627)":"Grass","(480, 609.681885)":"Grass","(480, 720.533142)":"Sand","(576, 443.404999)":"Sand","(576, 554.256226)":"Sand","(576, 665.107544)":"Sand"} +{"(-576, 0)":"Sand","(-576, 110.851242)":"Sand","(-480, -166.276886)":"Sand","(-480, -55.425629)":"Sand","(-480, 55.425613)":"Grass","(-480, 166.276855)":"Sand","(-480, 277.128113)":"Sand","(-480, 387.97937)":"Sand","(-384, -221.702499)":"Sand","(-384, -110.851242)":"Grass","(-384, 0)":"Grass","(-384, 110.85125)":"Grass","(-384, 221.702499)":"Grass","(-384, 332.553741)":"Sand","(-288, -166.276871)":"Sand","(-288, -55.425629)":"Grass","(-288, 55.425621)":"Grass","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Sand","(-192, -221.702484)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Grass","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Sand","(-96, -55.425625)":"Sand","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Sand","(0, 0)":"Sand","(0, 110.85125)":"Grass","(0, 221.702499)":"Sand","(96, -55.425625)":"Sand","(96, 55.425625)":"Grass","(96, 166.276871)":"Sand","(192, -332.553741)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Sand","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Sand","(288, -387.97937)":"Sand","(288, -277.128113)":"Grass","(288, -166.276871)":"Grass","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Grass","(288, 277.128113)":"Sand","(384, -443.404999)":"Sand","(384, -332.553741)":"Grass","(384, -221.702499)":"Grass","(384, -110.85125)":"Grass","(384, 0)":"Grass","(384, 110.851242)":"Sand","(384, 221.702499)":"Sand","(480, -387.97937)":"Sand","(480, -277.128113)":"Grass","(480, -166.276855)":"Grass","(480, -55.425613)":"Grass","(480, 55.425629)":"Sand","(576, -332.553741)":"Sand","(576, -221.702484)":"Sand","(576, -110.851242)":"Sand","(576, 0)":"Sand"} diff --git a/islands/pirate_game_island_3.island b/islands/pirate_game_island_3.island index 374d1e0..6c4d04a 100644 --- a/islands/pirate_game_island_3.island +++ b/islands/pirate_game_island_3.island @@ -1 +1 @@ -{"(-384, 0)":"Sand","(-384, 110.85125)":"Sand","(-384, 221.702499)":"Sand","(-384, 332.553741)":"Sand","(-288, -55.425629)":"Sand","(-288, 55.425621)":"Grass","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Sand","(-192, 0)":"Sand","(-192, 110.85125)":"Sand","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Sand","(-96, -387.97937)":"Sand","(-96, -277.128113)":"Sand","(-96, -166.276871)":"Sand","(-96, -55.425625)":"Sand","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Sand","(-96, 277.128113)":"Grass","(-96, 387.97937)":"Sand","(0, -443.404999)":"Sand","(0, -332.553741)":"Grass","(0, -221.702499)":"Sand","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Grass","(0, 332.553741)":"Grass","(0, 443.404999)":"Sand","(96, -498.830627)":"Sand","(96, -387.97937)":"Grass","(96, -277.128113)":"Sand","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Grass","(96, 277.128113)":"Grass","(96, 387.97937)":"Grass","(96, 498.830597)":"Sand","(192, -443.404999)":"Sand","(192, -332.553741)":"Grass","(192, -221.702499)":"Sand","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Grass","(192, 332.553741)":"Grass","(192, 443.404968)":"Sand","(288, -498.830627)":"Sand","(288, -387.97937)":"Grass","(288, -277.128113)":"Grass","(288, -166.276871)":"Grass","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Grass","(288, 277.128113)":"Sand","(288, 387.97937)":"Sand","(384, -554.256226)":"Sand","(384, -443.404999)":"Sand","(384, -332.553741)":"Grass","(384, -221.702499)":"Grass","(384, -110.85125)":"Grass","(384, 0)":"Grass","(384, 110.851242)":"Grass","(384, 221.702499)":"Sand","(384, 332.553711)":"Sand","(480, -498.830627)":"Sand","(480, -387.97937)":"Sand","(480, -277.128113)":"Grass","(480, -166.276855)":"Grass","(480, -55.425613)":"Grass","(480, 55.425629)":"Grass","(480, 166.276886)":"Grass","(480, 277.128113)":"Sand","(576, -443.404999)":"Sand","(576, -332.553741)":"Grass","(576, -221.702484)":"Grass","(576, -110.851242)":"Grass","(576, 0)":"Grass","(576, 110.851257)":"Grass","(576, 221.702484)":"Sand","(672, -387.97937)":"Sand","(672, -277.128113)":"Grass","(672, -166.276871)":"Sand","(672, -55.425629)":"Sand","(672, 55.425629)":"Grass","(672, 166.276855)":"Sand","(768, -332.553741)":"Sand","(768, -221.702499)":"Sand","(768, 0)":"Sand","(768, 110.851227)":"Sand"} +{"(-384, 110.85125)":"Sand","(-384, 221.702499)":"Sand","(-384, 332.553741)":"Sand","(-384, 443.404999)":"Sand","(-288, -55.425629)":"Sand","(-288, 55.425621)":"Sand","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Grass","(-288, 498.830627)":"Sand","(-288, 609.681885)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Grass","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Grass","(-192, 443.404999)":"Grass","(-192, 554.256226)":"Grass","(-192, 665.107483)":"Sand","(-96, -277.128113)":"Sand","(-96, -166.276871)":"Sand","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Sand","(-96, 277.128113)":"Sand","(-96, 387.97937)":"Sand","(-96, 498.830627)":"Sand","(-96, 609.681824)":"Grass","(-96, 720.533081)":"Sand","(0, -332.553741)":"Sand","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Sand","(0, 554.256226)":"Sand","(0, 665.107483)":"Grass","(0, 775.95874)":"Sand","(96, -387.97937)":"Sand","(96, -277.128113)":"Grass","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Sand","(96, 498.830597)":"Sand","(96, 609.681885)":"Grass","(96, 720.533142)":"Sand","(192, -332.553741)":"Sand","(192, -221.702499)":"Grass","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Sand","(192, 443.404968)":"Sand","(192, 554.256226)":"Grass","(192, 665.107483)":"Grass","(192, 775.95874)":"Sand","(288, -387.97937)":"Sand","(288, -277.128113)":"Grass","(288, -166.276871)":"Grass","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Sand","(288, 498.830627)":"Sand","(288, 609.681885)":"Sand","(288, 720.533142)":"Grass","(288, 831.384399)":"Sand","(384, -332.553741)":"Sand","(384, -221.702499)":"Grass","(384, -110.85125)":"Grass","(384, 0)":"Grass","(384, 110.851242)":"Sand","(384, 665.107483)":"Sand","(384, 775.95874)":"Sand","(480, -277.128113)":"Sand","(480, -166.276855)":"Sand","(480, -55.425613)":"Sand","(480, 55.425629)":"Sand","(480, 609.681885)":"Sand","(480, 720.533142)":"Sand","(576, 665.107544)":"Sand"} diff --git a/islands/pirate_game_island_4.island b/islands/pirate_game_island_4.island index 667f507..dca0634 100644 --- a/islands/pirate_game_island_4.island +++ b/islands/pirate_game_island_4.island @@ -1 +1 @@ -{"(-480, -387.97937)":"Sand","(-480, -277.128113)":"Sand","(-480, -166.276886)":"Sand","(-384, -443.404968)":"Sand","(-384, -332.553711)":"Grass","(-384, -221.702499)":"Sand","(-384, -110.851242)":"Sand","(-288, -498.830627)":"Sand","(-288, -387.97937)":"Grass","(-288, -277.128113)":"Grass","(-288, -166.276871)":"Grass","(-288, -55.425629)":"Sand","(-288, 720.533081)":"Sand","(-192, -443.404968)":"Sand","(-192, -332.553741)":"Grass","(-192, -221.702484)":"Grass","(-192, -110.85125)":"Grass","(-192, 0)":"Sand","(-192, 443.404999)":"Sand","(-192, 554.256226)":"Sand","(-192, 665.107483)":"Sand","(-192, 775.95874)":"Sand","(-96, -387.97937)":"Sand","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Sand","(-96, 166.276871)":"Sand","(-96, 277.128113)":"Sand","(-96, 387.97937)":"Sand","(-96, 498.830627)":"Grass","(-96, 609.681824)":"Grass","(-96, 720.533081)":"Grass","(-96, 831.384338)":"Sand","(0, -443.404999)":"Sand","(0, -332.553741)":"Grass","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Grass","(0, 332.553741)":"Grass","(0, 443.404999)":"Grass","(0, 554.256226)":"Grass","(0, 665.107483)":"Grass","(0, 775.95874)":"Grass","(0, 886.809998)":"Sand","(96, -498.830627)":"Sand","(96, -387.97937)":"Grass","(96, -277.128113)":"Grass","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Grass","(96, 277.128113)":"Grass","(96, 387.97937)":"Grass","(96, 498.830597)":"Grass","(96, 609.681885)":"Grass","(96, 720.533142)":"Grass","(96, 831.384399)":"Sand","(96, 942.235657)":"Sand","(192, -554.256226)":"Sand","(192, -443.404999)":"Grass","(192, -332.553741)":"Grass","(192, -221.702499)":"Grass","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Grass","(192, 332.553741)":"Grass","(192, 443.404968)":"Grass","(192, 554.256226)":"Grass","(192, 665.107483)":"Grass","(192, 775.95874)":"Grass","(192, 886.809998)":"Sand","(288, -498.830627)":"Sand","(288, -387.97937)":"Grass","(288, -277.128113)":"Grass","(288, -166.276871)":"Grass","(288, -55.425621)":"Grass","(288, 55.425629)":"Sand","(288, 166.276871)":"Sand","(288, 277.128113)":"Sand","(288, 387.97937)":"Grass","(288, 498.830627)":"Grass","(288, 609.681885)":"Grass","(288, 720.533142)":"Grass","(288, 831.384399)":"Sand","(384, -443.404999)":"Sand","(384, -332.553741)":"Grass","(384, -221.702499)":"Grass","(384, -110.85125)":"Grass","(384, 0)":"Sand","(384, 332.553711)":"Sand","(384, 443.404968)":"Sand","(384, 554.256226)":"Grass","(384, 665.107483)":"Grass","(384, 775.95874)":"Sand","(480, -498.830627)":"Sand","(480, -387.97937)":"Sand","(480, -277.128113)":"Grass","(480, -166.276855)":"Grass","(480, -55.425613)":"Sand","(480, 498.830627)":"Sand","(480, 609.681885)":"Grass","(480, 720.533142)":"Sand","(576, -443.404999)":"Sand","(576, -332.553741)":"Grass","(576, -221.702484)":"Sand","(576, -110.851242)":"Sand","(576, 554.256226)":"Sand","(576, 665.107544)":"Sand","(672, -387.97937)":"Sand","(672, -277.128113)":"Sand"} +{"(-384, -221.702499)":"Sand","(-384, -110.851242)":"Sand","(-384, 0)":"Sand","(-288, -277.128113)":"Sand","(-288, -166.276871)":"Grass","(-288, -55.425629)":"Grass","(-288, 55.425621)":"Sand","(-192, -221.702484)":"Sand","(-192, -110.85125)":"Grass","(-192, 0)":"Sand","(-96, -277.128113)":"Sand","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Sand","(-96, 498.830627)":"Sand","(0, -332.553741)":"Sand","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Sand","(0, 443.404999)":"Sand","(0, 554.256226)":"Sand","(0, 665.107483)":"Sand","(96, -277.128113)":"Sand","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Sand","(96, 166.276871)":"Sand","(96, 277.128113)":"Sand","(96, 387.97937)":"Sand","(96, 498.830597)":"Grass","(96, 609.681885)":"Sand","(96, 720.533142)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Grass","(192, 221.702484)":"Grass","(192, 332.553741)":"Grass","(192, 443.404968)":"Grass","(192, 554.256226)":"Grass","(192, 665.107483)":"Sand","(288, -166.276871)":"Sand","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Grass","(288, 277.128113)":"Grass","(288, 387.97937)":"Grass","(288, 498.830627)":"Grass","(288, 609.681885)":"Grass","(288, 720.533142)":"Sand","(384, -110.85125)":"Sand","(384, 0)":"Sand","(384, 110.851242)":"Sand","(384, 221.702499)":"Grass","(384, 332.553711)":"Grass","(384, 443.404968)":"Grass","(384, 554.256226)":"Grass","(384, 665.107483)":"Sand","(480, 166.276886)":"Sand","(480, 277.128113)":"Sand","(480, 387.97937)":"Grass","(480, 498.830627)":"Grass","(480, 609.681885)":"Sand","(576, 332.553741)":"Sand","(576, 443.404999)":"Sand","(576, 554.256226)":"Sand"} diff --git a/islands/pirate_game_island_5.island b/islands/pirate_game_island_5.island new file mode 100644 index 0000000..0865981 --- /dev/null +++ b/islands/pirate_game_island_5.island @@ -0,0 +1 @@ +{"(-384, 443.404999)":"Sand","(-384, 554.256226)":"Sand","(-384, 665.107483)":"Sand","(-288, -55.425629)":"Sand","(-288, 55.425621)":"Sand","(-288, 387.97937)":"Sand","(-288, 498.830627)":"Grass","(-288, 609.681885)":"Grass","(-288, 720.533081)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Grass","(-192, 110.85125)":"Sand","(-192, 221.702499)":"Sand","(-192, 332.553741)":"Sand","(-192, 443.404999)":"Grass","(-192, 554.256226)":"Grass","(-192, 665.107483)":"Sand","(-96, -166.276871)":"Sand","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Grass","(-96, 387.97937)":"Grass","(-96, 498.830627)":"Grass","(-96, 609.681824)":"Grass","(-96, 720.533081)":"Sand","(0, -221.702499)":"Sand","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Grass","(0, 332.553741)":"Grass","(0, 443.404999)":"Grass","(0, 554.256226)":"Grass","(0, 665.107483)":"Grass","(0, 775.95874)":"Sand","(96, -277.128113)":"Sand","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Sand","(96, 166.276871)":"Sand","(96, 277.128113)":"Sand","(96, 387.97937)":"Grass","(96, 498.830597)":"Grass","(96, 609.681885)":"Grass","(96, 720.533142)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Sand","(192, 0)":"Sand","(192, 332.553741)":"Sand","(192, 443.404968)":"Sand","(192, 554.256226)":"Grass","(192, 665.107483)":"Grass","(192, 775.95874)":"Sand","(288, 498.830627)":"Sand","(288, 609.681885)":"Grass","(288, 720.533142)":"Sand","(384, 554.256226)":"Sand","(384, 665.107483)":"Grass","(384, 775.95874)":"Sand","(480, 498.830627)":"Sand","(480, 609.681885)":"Sand","(480, 720.533142)":"Sand","(576, 554.256226)":"Sand"} diff --git a/islands/pirate_game_island_6.island b/islands/pirate_game_island_6.island new file mode 100644 index 0000000..2a2b535 --- /dev/null +++ b/islands/pirate_game_island_6.island @@ -0,0 +1 @@ +{"(-576, 221.702484)":"Sand","(-576, 332.553741)":"Sand","(-576, 443.404999)":"Sand","(-576, 554.256226)":"Sand","(-480, 166.276855)":"Sand","(-480, 277.128113)":"Grass","(-480, 387.97937)":"Grass","(-480, 498.830627)":"Grass","(-480, 609.681885)":"Sand","(-384, 110.85125)":"Sand","(-384, 221.702499)":"Grass","(-384, 332.553741)":"Grass","(-384, 443.404999)":"Grass","(-384, 554.256226)":"Grass","(-384, 665.107483)":"Sand","(-288, 55.425621)":"Sand","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Grass","(-288, 498.830627)":"Grass","(-288, 609.681885)":"Sand","(-192, -332.553741)":"Sand","(-192, -221.702484)":"Sand","(-192, -110.85125)":"Sand","(-192, 0)":"Sand","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Grass","(-192, 443.404999)":"Grass","(-192, 554.256226)":"Grass","(-192, 665.107483)":"Sand","(-96, -387.97937)":"Sand","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Sand","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Grass","(-96, 387.97937)":"Grass","(-96, 498.830627)":"Grass","(-96, 609.681824)":"Sand","(0, -443.404999)":"Sand","(0, -332.553741)":"Grass","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Sand","(0, 110.85125)":"Sand","(0, 221.702499)":"Sand","(0, 332.553741)":"Grass","(0, 443.404999)":"Grass","(0, 554.256226)":"Grass","(0, 665.107483)":"Sand","(96, -387.97937)":"Sand","(96, -277.128113)":"Grass","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Sand","(96, 277.128113)":"Sand","(96, 387.97937)":"Sand","(96, 498.830597)":"Sand","(96, 609.681885)":"Sand","(192, -443.404999)":"Sand","(192, -332.553741)":"Grass","(192, -221.702499)":"Grass","(192, -110.85125)":"Grass","(192, 0)":"Grass","(192, 110.85125)":"Sand","(192, 332.553741)":"Sand","(192, 554.256226)":"Sand","(288, -387.97937)":"Sand","(288, -277.128113)":"Grass","(288, -166.276871)":"Grass","(288, -55.425621)":"Grass","(288, 55.425629)":"Grass","(288, 166.276871)":"Sand","(384, -443.404999)":"Sand","(384, -332.553741)":"Grass","(384, -221.702499)":"Grass","(384, -110.85125)":"Grass","(384, 0)":"Grass","(384, 110.851242)":"Sand","(480, -387.97937)":"Sand","(480, -277.128113)":"Sand","(480, -166.276855)":"Grass","(480, -55.425613)":"Sand","(480, 55.425629)":"Sand","(576, -221.702484)":"Sand","(576, -110.851242)":"Sand"} diff --git a/islands/pirate_game_island_7.island b/islands/pirate_game_island_7.island new file mode 100644 index 0000000..d18b168 --- /dev/null +++ b/islands/pirate_game_island_7.island @@ -0,0 +1 @@ +{"(-672, -166.276855)":"Sand","(-672, -55.425629)":"Sand","(-672, 55.425629)":"Sand","(-672, 166.276871)":"Sand","(-576, -332.553741)":"Sand","(-576, -221.702484)":"Sand","(-576, -110.851257)":"Grass","(-576, 0)":"Grass","(-576, 110.851242)":"Grass","(-576, 221.702484)":"Sand","(-480, -387.97937)":"Sand","(-480, -277.128113)":"Grass","(-480, -166.276886)":"Grass","(-480, -55.425629)":"Grass","(-480, 55.425613)":"Grass","(-480, 166.276855)":"Grass","(-480, 277.128113)":"Sand","(-384, -332.553711)":"Sand","(-384, -221.702499)":"Grass","(-384, -110.851242)":"Grass","(-384, 0)":"Grass","(-384, 110.85125)":"Grass","(-384, 221.702499)":"Sand","(-384, 554.256226)":"Sand","(-384, 665.107483)":"Sand","(-384, 775.95874)":"Sand","(-288, -387.97937)":"Sand","(-288, -277.128113)":"Grass","(-288, -166.276871)":"Grass","(-288, -55.425629)":"Grass","(-288, 55.425621)":"Grass","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Sand","(-288, 387.97937)":"Sand","(-288, 498.830627)":"Sand","(-288, 609.681885)":"Grass","(-288, 720.533081)":"Grass","(-288, 831.384338)":"Sand","(-192, -443.404968)":"Sand","(-192, -332.553741)":"Grass","(-192, -221.702484)":"Grass","(-192, -110.85125)":"Grass","(-192, 0)":"Grass","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Sand","(-192, 443.404999)":"Sand","(-192, 554.256226)":"Grass","(-192, 665.107483)":"Grass","(-192, 775.95874)":"Sand","(-96, -387.97937)":"Sand","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Sand","(-96, 498.830627)":"Sand","(-96, 609.681824)":"Grass","(-96, 720.533081)":"Sand","(0, -332.553741)":"Sand","(0, -221.702499)":"Sand","(0, -110.85125)":"Grass","(0, 0)":"Sand","(0, 110.85125)":"Sand","(0, 554.256226)":"Sand","(0, 665.107483)":"Sand","(0, 775.95874)":"Sand","(96, -166.276871)":"Sand","(96, -55.425625)":"Sand"} diff --git a/islands/pirate_game_island_8.island b/islands/pirate_game_island_8.island new file mode 100644 index 0000000..9a084a4 --- /dev/null +++ b/islands/pirate_game_island_8.island @@ -0,0 +1 @@ +{"(-864, 387.97937)":"Sand","(-864, 498.830627)":"Sand","(-768, 221.702499)":"Sand","(-768, 332.553741)":"Sand","(-768, 443.404999)":"Grass","(-768, 554.256226)":"Sand","(-768, 665.107483)":"Sand","(-672, 166.276871)":"Sand","(-672, 277.128113)":"Grass","(-672, 387.97937)":"Grass","(-672, 498.830627)":"Grass","(-672, 609.681885)":"Grass","(-672, 720.533081)":"Sand","(-576, 221.702484)":"Sand","(-576, 332.553741)":"Grass","(-576, 443.404999)":"Grass","(-576, 554.256226)":"Grass","(-576, 665.107483)":"Sand","(-480, -387.97937)":"Sand","(-480, 277.128113)":"Sand","(-480, 387.97937)":"Grass","(-480, 498.830627)":"Grass","(-480, 609.681885)":"Sand","(-384, -443.404968)":"Sand","(-384, -332.553711)":"Sand","(-384, -221.702499)":"Sand","(-384, 221.702499)":"Sand","(-384, 332.553741)":"Grass","(-384, 443.404999)":"Grass","(-384, 554.256226)":"Grass","(-384, 665.107483)":"Sand","(-288, -498.830627)":"Sand","(-288, -387.97937)":"Grass","(-288, -277.128113)":"Grass","(-288, -166.276871)":"Sand","(-288, 166.276871)":"Sand","(-288, 277.128113)":"Grass","(-288, 387.97937)":"Grass","(-288, 498.830627)":"Grass","(-288, 609.681885)":"Sand","(-192, -443.404968)":"Sand","(-192, -332.553741)":"Grass","(-192, -221.702484)":"Grass","(-192, -110.85125)":"Sand","(-192, 0)":"Sand","(-192, 110.85125)":"Sand","(-192, 221.702499)":"Grass","(-192, 332.553741)":"Grass","(-192, 443.404999)":"Grass","(-192, 554.256226)":"Sand","(-96, -498.830597)":"Sand","(-96, -387.97937)":"Grass","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Sand","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Grass","(-96, 387.97937)":"Sand","(-96, 498.830627)":"Sand","(0, -443.404999)":"Sand","(0, -332.553741)":"Grass","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Sand","(0, 332.553741)":"Sand","(96, -387.97937)":"Sand","(96, -277.128113)":"Grass","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Sand","(96, 166.276871)":"Sand","(192, -443.404999)":"Sand","(192, -332.553741)":"Grass","(192, -221.702499)":"Grass","(192, -110.85125)":"Sand","(192, 0)":"Sand","(288, -387.97937)":"Sand","(288, -277.128113)":"Sand","(288, -166.276871)":"Sand"} diff --git a/islands/pirate_game_island_9.island b/islands/pirate_game_island_9.island new file mode 100644 index 0000000..5649e0e --- /dev/null +++ b/islands/pirate_game_island_9.island @@ -0,0 +1 @@ +{"(-864, 166.276886)":"Sand","(-864, 277.128113)":"Sand","(-864, 387.97937)":"Sand","(-768, 110.851257)":"Sand","(-768, 221.702499)":"Grass","(-768, 332.553741)":"Grass","(-768, 443.404999)":"Sand","(-672, 55.425629)":"Sand","(-672, 166.276871)":"Grass","(-672, 277.128113)":"Grass","(-672, 387.97937)":"Grass","(-672, 498.830627)":"Sand","(-672, 609.681885)":"Sand","(-672, 720.533081)":"Sand","(-576, -110.851257)":"Sand","(-576, 0)":"Sand","(-576, 110.851242)":"Sand","(-576, 221.702484)":"Grass","(-576, 332.553741)":"Grass","(-576, 443.404999)":"Grass","(-576, 554.256226)":"Grass","(-576, 665.107483)":"Grass","(-576, 775.95874)":"Sand","(-576, 886.809937)":"Sand","(-480, -277.128113)":"Sand","(-480, -166.276886)":"Sand","(-480, -55.425629)":"Grass","(-480, 55.425613)":"Grass","(-480, 166.276855)":"Grass","(-480, 277.128113)":"Grass","(-480, 387.97937)":"Grass","(-480, 498.830627)":"Grass","(-480, 609.681885)":"Grass","(-480, 720.533081)":"Grass","(-480, 831.384338)":"Sand","(-384, -332.553711)":"Sand","(-384, -221.702499)":"Grass","(-384, -110.851242)":"Grass","(-384, 0)":"Grass","(-384, 110.85125)":"Grass","(-384, 221.702499)":"Sand","(-384, 332.553741)":"Sand","(-384, 443.404999)":"Grass","(-384, 554.256226)":"Grass","(-384, 665.107483)":"Grass","(-384, 775.95874)":"Sand","(-288, -387.97937)":"Sand","(-288, -277.128113)":"Grass","(-288, -166.276871)":"Grass","(-288, -55.425629)":"Grass","(-288, 55.425621)":"Grass","(-288, 166.276871)":"Grass","(-288, 277.128113)":"Sand","(-288, 387.97937)":"Sand","(-288, 498.830627)":"Sand","(-288, 609.681885)":"Sand","(-288, 720.533081)":"Sand","(-192, -443.404968)":"Sand","(-192, -332.553741)":"Grass","(-192, -221.702484)":"Grass","(-192, -110.85125)":"Grass","(-192, 0)":"Grass","(-192, 110.85125)":"Grass","(-192, 221.702499)":"Sand","(-96, -498.830597)":"Sand","(-96, -387.97937)":"Grass","(-96, -277.128113)":"Grass","(-96, -166.276871)":"Grass","(-96, -55.425625)":"Grass","(-96, 55.425625)":"Grass","(-96, 166.276871)":"Grass","(-96, 277.128113)":"Sand","(0, -443.404999)":"Sand","(0, -332.553741)":"Grass","(0, -221.702499)":"Grass","(0, -110.85125)":"Grass","(0, 0)":"Grass","(0, 110.85125)":"Grass","(0, 221.702499)":"Grass","(0, 332.553741)":"Sand","(96, -387.97937)":"Sand","(96, -277.128113)":"Sand","(96, -166.276871)":"Grass","(96, -55.425625)":"Grass","(96, 55.425625)":"Grass","(96, 166.276871)":"Sand","(96, 277.128113)":"Sand","(192, -221.702499)":"Sand","(192, -110.85125)":"Sand","(192, 0)":"Sand","(192, 110.85125)":"Sand"} diff --git a/project.godot b/project.godot index f1bc577..d28fad5 100644 --- a/project.godot +++ b/project.godot @@ -10,7 +10,6 @@ config_version=4 _global_script_classes=[ ] _global_script_class_icons={ - } [application] diff --git a/scenes/Editor.gd b/scenes/Editor.gd index e72ec44..59c9ddb 100644 --- a/scenes/Editor.gd +++ b/scenes/Editor.gd @@ -16,14 +16,17 @@ onready var world = get_node("../World") onready var world_camera = get_node("../World/Camera") var last_index = -1 +var Island = preload("Island.gd") +var island = null + # Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. + island = Island.new() + island.load_island("res://islands/pirate_game_island_0.island") + add_child(island) func handle_editor_event(event): - var island = world.current_island - if (Input.get_mouse_button_mask() & BUTTON_LEFT) == BUTTON_LEFT: # if event.pressed and event.button_index == BUTTON_LEFT: var pressed_button = NoneButton.group.get_pressed_button() @@ -39,17 +42,27 @@ func handle_editor_event(event): return false +func _process(_delta): + world.Islands.visible = !EditorUI.visible + island.visible = EditorUI.visible + + +func is_active(): + return EditorUI.visible + + func _unhandled_input(event): if not EditorUI.visible: return if event is InputEventMouseButton: if handle_editor_event (event): - return + get_tree().set_input_as_handled() + update() if 'position' in event: if handle_editor_event (event): - return + get_tree().set_input_as_handled() update() @@ -63,17 +76,14 @@ func get_island_filename(): func _on_SaveWorldButton_pressed(): - var island = world.current_island island.save_island(get_island_filename()) func _on_ClearWorldButton_pressed(): - var island = world.current_island island.clear_island() func _on_LoadWorldButton_pressed(): - var island = world.current_island island.load_island(get_island_filename()) last_index = IslandIndex.value @@ -84,9 +94,7 @@ func _on_EditIslandButton_toggled(button_pressed): func _on_IslandIndex_value_changed(_value): - var island = world.current_island if last_index >= 0: island.save_island(get_island_filename_for_index(last_index)) island.clear_island() island.load_island(get_island_filename()) - diff --git a/scenes/Game.tscn b/scenes/Game.tscn index d1e523c..99ba38d 100644 --- a/scenes/Game.tscn +++ b/scenes/Game.tscn @@ -22,6 +22,90 @@ resource_name = "TileTypeGroup" [node name="GameRoot" type="Node"] +[node name="Editor" type="Node2D" parent="."] +script = ExtResource( 7 ) + +[node name="UI" type="CanvasLayer" parent="Editor"] + +[node name="Editor" type="VBoxContainer" parent="Editor/UI"] +visible = false +margin_left = 12.0 +margin_top = 53.0 +margin_right = 94.0 +margin_bottom = 600.0 +theme = SubResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Island" type="Label" parent="Editor/UI/Editor"] +margin_right = 110.0 +margin_bottom = 33.0 +text = "Island" + +[node name="IslandIndex" type="SpinBox" parent="Editor/UI/Editor"] +margin_top = 37.0 +margin_right = 110.0 +margin_bottom = 80.0 +max_value = 9.0 + +[node name="ClearWorldButton" type="Button" parent="Editor/UI/Editor"] +margin_top = 84.0 +margin_right = 110.0 +margin_bottom = 123.0 +text = "Clear" + +[node name="LoadWorldButton" type="Button" parent="Editor/UI/Editor"] +margin_top = 127.0 +margin_right = 110.0 +margin_bottom = 166.0 +text = "Load" + +[node name="SaveWorldButton" type="Button" parent="Editor/UI/Editor"] +margin_top = 170.0 +margin_right = 110.0 +margin_bottom = 209.0 +text = "Save" + +[node name="Label" type="Label" parent="Editor/UI/Editor"] +margin_top = 213.0 +margin_right = 110.0 +margin_bottom = 246.0 +text = "Tiles" + +[node name="NoneButton" type="Button" parent="Editor/UI/Editor"] +margin_top = 250.0 +margin_right = 110.0 +margin_bottom = 289.0 +rect_pivot_offset = Vector2( -1239.87, 282.07 ) +toggle_mode = true +group = SubResource( 3 ) +text = "None" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SandButton" type="Button" parent="Editor/UI/Editor"] +margin_top = 293.0 +margin_right = 110.0 +margin_bottom = 332.0 +rect_pivot_offset = Vector2( -1239.87, 282.07 ) +toggle_mode = true +group = SubResource( 3 ) +text = "Sand" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="GrassButton" type="Button" parent="Editor/UI/Editor"] +margin_top = 336.0 +margin_right = 110.0 +margin_bottom = 375.0 +rect_pivot_offset = Vector2( -1239.87, 282.07 ) +toggle_mode = true +group = SubResource( 3 ) +text = "Grass" + [node name="World" type="Node2D" parent="."] script = ExtResource( 1 ) @@ -171,92 +255,9 @@ current = true scale = Vector2( 0.455, 0.455 ) texture = ExtResource( 9 ) -[node name="Editor" type="Node2D" parent="."] -script = ExtResource( 7 ) - -[node name="UI" type="CanvasLayer" parent="Editor"] - -[node name="Editor" type="VBoxContainer" parent="Editor/UI"] -visible = false -margin_left = 12.0 -margin_top = 53.0 -margin_right = 94.0 -margin_bottom = 600.0 -theme = SubResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Island" type="Label" parent="Editor/UI/Editor"] -margin_right = 110.0 -margin_bottom = 33.0 -text = "Island" - -[node name="IslandIndex" type="SpinBox" parent="Editor/UI/Editor"] -margin_top = 37.0 -margin_right = 110.0 -margin_bottom = 80.0 -max_value = 9.0 - -[node name="ClearWorldButton" type="Button" parent="Editor/UI/Editor"] -margin_top = 84.0 -margin_right = 110.0 -margin_bottom = 123.0 -text = "Clear" - -[node name="LoadWorldButton" type="Button" parent="Editor/UI/Editor"] -margin_top = 127.0 -margin_right = 110.0 -margin_bottom = 166.0 -text = "Load" - -[node name="SaveWorldButton" type="Button" parent="Editor/UI/Editor"] -margin_top = 170.0 -margin_right = 110.0 -margin_bottom = 209.0 -text = "Save" - -[node name="Label" type="Label" parent="Editor/UI/Editor"] -margin_top = 213.0 -margin_right = 110.0 -margin_bottom = 246.0 -text = "Tiles" - -[node name="NoneButton" type="Button" parent="Editor/UI/Editor"] -margin_top = 250.0 -margin_right = 110.0 -margin_bottom = 289.0 -rect_pivot_offset = Vector2( -1239.87, 282.07 ) -toggle_mode = true -group = SubResource( 3 ) -text = "None" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="SandButton" type="Button" parent="Editor/UI/Editor"] -margin_top = 293.0 -margin_right = 110.0 -margin_bottom = 332.0 -rect_pivot_offset = Vector2( -1239.87, 282.07 ) -toggle_mode = true -group = SubResource( 3 ) -text = "Sand" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="GrassButton" type="Button" parent="Editor/UI/Editor"] -margin_top = 336.0 -margin_right = 110.0 -margin_bottom = 375.0 -rect_pivot_offset = Vector2( -1239.87, 282.07 ) -toggle_mode = true -group = SubResource( 3 ) -text = "Grass" -[connection signal="toggled" from="World/UI/TopContainer/EditIslandButton" to="Editor" method="_on_EditIslandButton_toggled"] -[connection signal="pressed" from="World/UI/TopContainer/Button" to="World" method="_on_generate_button_pressed"] [connection signal="value_changed" from="Editor/UI/Editor/IslandIndex" to="Editor" method="_on_IslandIndex_value_changed"] [connection signal="pressed" from="Editor/UI/Editor/ClearWorldButton" to="Editor" method="_on_ClearWorldButton_pressed"] [connection signal="pressed" from="Editor/UI/Editor/LoadWorldButton" to="Editor" method="_on_LoadWorldButton_pressed"] [connection signal="pressed" from="Editor/UI/Editor/SaveWorldButton" to="Editor" method="_on_SaveWorldButton_pressed"] +[connection signal="toggled" from="World/UI/TopContainer/EditIslandButton" to="Editor" method="_on_EditIslandButton_toggled"] +[connection signal="pressed" from="World/UI/TopContainer/Button" to="World" method="_on_generate_button_pressed"] diff --git a/scenes/World.gd b/scenes/World.gd index 19f8367..c39e674 100644 --- a/scenes/World.gd +++ b/scenes/World.gd @@ -3,6 +3,7 @@ extends Node2D onready var Grid = get_node("Grid") onready var GridHighlight = get_node("GridHighlight") +onready var Editor = get_node("../Editor") onready var Islands = get_node("Islands") onready var EditIslandButton = get_node("UI/TopContainer/EditIslandButton") @@ -48,7 +49,8 @@ func _ready(): func _process(_delta): - WorldCamera.offset = PlayerChar.position + if Editor == null or not Editor.is_active(): + WorldCamera.offset = PlayerChar.position if len(player_navigation_path) > 1: var player_coord = Globals.WorldToHexCenter(PlayerChar.transform.origin) @@ -140,7 +142,7 @@ func generate(): for i in range (num_islands): var island = Island.new() - var island_index = i % 5 + var island_index = i % 10 var file_name = "res://islands/pirate_game_island_" + str(island_index) + ".island" island.load_island(file_name) @@ -346,6 +348,9 @@ func _on_generate_button_pressed(): func handle_game_event(event): + if Editor and Editor.is_active(): + return false + if event is InputEventMouseButton: # Move main character if event.pressed and event.button_index == BUTTON_LEFT: