More island variety

master
Martin Felis 2021-07-20 22:51:38 +02:00
parent 659c0fcfcc
commit 80edbb7dc2
14 changed files with 17 additions and 9 deletions

View File

@ -15,7 +15,8 @@ var DebugLabel = null
var hex_size = 128
var debug_nav = false
var draw_grid = true
var draw_grid = false
var draw_island_bbox = false
# Called when the node enters the scene tree for the first time.
func _ready():

Binary file not shown.

View File

@ -317,7 +317,6 @@ rect_min_size = Vector2( 100, 100 )
text = "Dig"
[node name="SuccessMessage" type="Control" parent="World/UI"]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
@ -327,7 +326,7 @@ margin_top = -20.0
margin_right = 20.0
margin_bottom = 20.0
rect_scale = Vector2( 0.5, 0.5 )
mouse_filter = 1
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
@ -341,6 +340,7 @@ margin_left = -706.0
margin_top = -264.0
margin_right = 706.0
margin_bottom = 264.0
mouse_filter = 2
texture = ExtResource( 11 )
stretch_mode = 4
__meta__ = {
@ -400,6 +400,7 @@ script = ExtResource( 13 )
[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="bird_flight_start" from="World" to="SoundEffectsPlayer" method="_on_World_bird_flight_start"]
[connection signal="digging_started" from="World" to="SoundEffectsPlayer" method="_on_World_digging_started"]
[connection signal="map_opened" from="World" to="SoundEffectsPlayer" method="_on_World_map_opened"]
[connection signal="treasure_found" from="World" to="SoundEffectsPlayer" method="_on_World_treasure_found"]
[connection signal="world_generation_triggered" from="World" to="SoundEffectsPlayer" method="_on_World_world_generation_triggered"]

View File

@ -174,6 +174,6 @@ func _draw():
draw_set_transform (treasure_local_coords + offset_world, 0, Vector2.ONE)
draw_polygon(HexTileDrawer.HexPoints, HexTileDrawer.create_color_array("#922"))
if Globals.draw_island_bbox:
draw_set_transform(transform.origin, transform.get_rotation(), transform.get_scale())
draw_rect(rect_world, Color.red, false)

View File

@ -50,3 +50,8 @@ func _on_World_wrong_digsite():
func _on_World_world_generation_triggered():
stream = noch_einen_schatz_finden
play()
func _on_World_digging_started():
stream = hauruck
play()

View File

@ -58,6 +58,7 @@ var birdy_spring_v = Vector2.ZERO
var birdy_spring_xt = Vector2.ONE
var birdy_duration = 4.0
signal digging_started
signal world_generation_triggered
signal wrong_digsite
signal treasure_found
@ -278,12 +279,11 @@ func generate():
rng.randomize()
randomize()
var radius = 800
var num_islands = 4
var island_files = []
for i in range (num_islands):
for i in range (10):
island_files.append("res://islands/pirate_game_island_" + str(i) + ".island")
island_files.shuffle()
@ -631,6 +631,7 @@ func _on_BirdyButton_pressed():
func _on_DigButton_pressed():
print ("dig pressed")
if PlayerChar.state == PlayerChar.State.Walking:
emit_signal("digging_started")
PlayerChar.on_dig_start()

View File

@ -73,7 +73,7 @@ func on_leave_island():
func on_dig_start():
print ("Start digging")
state = State.Digging
DigTimer.start(1.0)
DigTimer.start(2.0)
func on_dig_stop():