File tree Expand file tree Collapse file tree 6 files changed +26
-17
lines changed
Expand file tree Collapse file tree 6 files changed +26
-17
lines changed Original file line number Diff line number Diff line change 1- [gd_scene load_steps =24 format =2 ]
1+ [gd_scene load_steps =23 format =2 ]
22
33[ext_resource path ="res://Player.tscn" type ="PackedScene" id =1 ]
44[ext_resource path ="res://EditorTileset.tres" type ="TileSet" id =2 ]
55[ext_resource path ="res://World.gd" type ="Script" id =3 ]
6- [ext_resource path ="res://Rooms/Sacrifice/Begin.tscn" type ="PackedScene" id =4 ]
76[ext_resource path ="res://dpcomic.ttf" type ="DynamicFontData" id =5 ]
87[ext_resource path ="res://HUD.gd" type ="Script" id =6 ]
98[ext_resource path ="res://Minimap.gd" type ="Script" id =7 ]
@@ -501,8 +500,6 @@ collision_layer = 2
501500format = 1
502501script = ExtResource ( 3 )
503502
504- [node name ="Room" parent ="World" instance =ExtResource ( 4 )]
505-
506503[node name ="Camera2D" type ="Camera2D" parent ="." groups =[
507504"Camera" ,
508505]]
Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ var advice := [
2626var player_died := false
2727var last_pickup :Item = null
2828func _ready ():
29- $ HUD/Generating/UsefulAdvice .text = advice [randi ()% advice .size ()]
29+ if Items .level == 1 :
30+ Items .using_seed = Items .WorldRNG .seed
31+ $ HUD/Generating/UsefulAdvice .text = advice [randi ()% advice .size ()] + "\n "
32+ $ HUD/Generating/UsefulAdvice .text += "Seed: " + str (Items .using_seed )
3033var end_times : String
3134func _process (delta ):
3235 if last_pickup == null :
@@ -43,7 +46,8 @@ func _process(delta):
4346 if player_died :
4447 $ HUD/Death .modulate .a = move_toward ($ HUD/Death .modulate .a , 1.0 , 0.2 )
4548 $ HUD/Death/Info .text = "Run Time: " + end_times + "\n "
46- $ HUD/Death/Info .text += "Levels: " + str (Items .level ) + "\n\n "
49+ $ HUD/Death/Info .text += "Levels: " + str (Items .level ) + "\n "
50+ $ HUD/Death/Info .text += "Seed: " + str (Items .using_seed ) + "\n\n "
4751 $ HUD/Death/Info .text += "Right click to start a new run"
4852 if $ HUD/Generating .modulate .a > 0.9 :
4953 Items .reset_player ()
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ var custom_seed := 0
3838
3939var level := 1
4040
41+ var using_seed := 0
42+
4143func _ready ():
4244 var generator_seed := hash (OS .get_time ())
4345 print ("Generator seed: " , generator_seed )
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ func _ready():
66
77func _on_NewRun_pressed ():
88 if not $ LineEdit .text == "" :
9- Items .custom_seed = hash ($ LineEdit .text )
9+ if $ LineEdit .text .is_valid_integer ():
10+ Items .custom_seed = $ LineEdit .text as int
11+ else :
12+ Items .custom_seed = hash ($ LineEdit .text )
1013 if Items .custom_seed == 0 :
1114 Items .custom_seed = 1
1215 Items .WorldRNG .seed = Items .custom_seed
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ size = 12
4747position = Vector2 ( 408 , 176 )
4848size = 12
4949
50- [node name ="ElevatorDoor" parent ="." instance =ExtResource ( 4 )]
50+ [node name ="ElevatorDoor" parent ="." groups =[
51+ "Elevator" ,
52+ ] instance =ExtResource ( 4 )]
5153position = Vector2 ( 264 , 240 )
5254came_from = true
Original file line number Diff line number Diff line change @@ -13,20 +13,21 @@ var last_frame_msecs :int
1313var iterations := 3
1414
1515func _ready ():
16+ print ("Generating dungeon" )
1617 position = Vector2 (0 , 0 )
17- areas .append ($ Room .get_used_rect ())
18+ print ("Step 0: Generating first room" )
19+ var first_room :TileMap
20+ if Items .level == 1 :
21+ first_room = preload ("res://Rooms/Sacrifice/Begin.tscn" ).instance ()
22+ add_child (first_room )
23+ else :
24+ first_room = preload ("res://Rooms/Sacrifice/BeginL2.tscn" ).instance ()
25+ add_child (first_room )
26+ areas .append (first_room .get_used_rect ())
1827 areas [0 ].position *= 8.0
1928 areas [0 ].size *= 8.0
2029 max_point = areas [0 ].position + areas [0 ].size
2130 min_point = Vector2 .ZERO
22- print ("Generating dungeon" )
23- print ("Step 0: Generating first room" )
24- if Items .level == 1 :
25- var n := preload ("res://Rooms/Sacrifice/Begin.tscn" ).instance ()
26- add_child (n )
27- else :
28- var n := preload ("res://Rooms/Sacrifice/BeginL2.tscn" ).instance ()
29- add_child (n )
3031 print ("Step 1: Generating layout of the world" )
3132 var rooms := 0
3233 var generated_end_room := false
You can’t perform that action at this time.
0 commit comments