From 04eb4846e8cab44ebcb98f310017b352a4d45214 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Wed, 8 Jul 2020 14:30:46 +0200 Subject: [PATCH] WIP electrical work --- Actors/Components/PowerManager.gd | 10 ++++ .../Objects/ElectricSocket/ElectricSocket.gd | 53 ++++++++++++++++++ .../ElectricSocket/ElectricSocket.tscn | 45 +++++++++++++++ Actors/Objects/PowerStorage/PowerStorage.gd | 20 +++++++ Actors/Objects/PowerStorage/PowerStorage.tscn | 18 +++--- Actors/Objects/Scanner/Scanner.tscn | 6 +- Actors/Systems/Electricity/ElectricProbe.gd | 25 +++++++++ Actors/Systems/Electricity/ElectricProbe.tscn | 36 ++++++++++++ Actors/Systems/Electricity/Electricity.gd | 1 + Graphics/tgstation/cables.tres | 2 +- Graphics/tgstation/socket.png | Bin 0 -> 301 bytes Graphics/tgstation/socket.png.import | 34 +++++++++++ Graphics/tgstation/wires-l2.png.import | 2 +- Scenes/Game.tscn | 1 - Scenes/Map.gd | 36 +++++++++--- Scenes/Maps/odyssey.tscn | 7 --- Scenes/Maps/runtime.gd | 6 -- Scenes/Maps/runtime.tscn | 51 +++++++++-------- Scenes/Rendering/MapTiles.gd | 10 +++- Scenes/World.gd | 3 +- project.godot | 18 ++++++ 21 files changed, 325 insertions(+), 59 deletions(-) create mode 100644 Actors/Components/PowerManager.gd create mode 100644 Actors/Objects/ElectricSocket/ElectricSocket.gd create mode 100644 Actors/Objects/ElectricSocket/ElectricSocket.tscn create mode 100644 Actors/Systems/Electricity/ElectricProbe.gd create mode 100644 Actors/Systems/Electricity/ElectricProbe.tscn create mode 100644 Actors/Systems/Electricity/Electricity.gd create mode 100644 Graphics/tgstation/socket.png create mode 100644 Graphics/tgstation/socket.png.import diff --git a/Actors/Components/PowerManager.gd b/Actors/Components/PowerManager.gd new file mode 100644 index 0000000..add1b7f --- /dev/null +++ b/Actors/Components/PowerManager.gd @@ -0,0 +1,10 @@ +extends Node + +class_name PowerManager + +signal power_connected() +signal power_disconnected() + +var wired = false + +const DEBUG = true diff --git a/Actors/Objects/ElectricSocket/ElectricSocket.gd b/Actors/Objects/ElectricSocket/ElectricSocket.gd new file mode 100644 index 0000000..f5ce9d4 --- /dev/null +++ b/Actors/Objects/ElectricSocket/ElectricSocket.gd @@ -0,0 +1,53 @@ +tool + +extends Area2D + +enum Direction { LEFT, RIGHT, UP, DOWN } +enum Flow { SOURCE, SINK } + +export(Direction) var direction = Direction.DOWN setget set_direction + +export(Array, NodePath) var connections = [] + +export(Color) var source_color +export(Color) var sink_color + +export(Flow) var flow = Flow.SINK setget set_flow + +var ready = false + +func _ready(): + ready = true + $socket.material = $socket.material.duplicate() + refresh_sprite() + +func set_direction(dir): + direction = dir + if ready: + refresh_sprite() + +func set_flow(val): + flow = val + if ready: + refresh_sprite() + +func refresh_sprite(): + var rot = 0 + match direction: + Direction.DOWN: + $socket.region_rect.position = Vector2(0, 0) + rot = 0 + Direction.UP: + $socket.region_rect.position = Vector2(32, 0) + rot = PI + Direction.LEFT: + $socket.region_rect.position = Vector2(32, 32) + rot = PI/2 + Direction.RIGHT: + $socket.region_rect.position = Vector2(0, 32) + rot = -PI/2 + match flow: + Flow.SOURCE: + $socket.material.set_shader_param("cable_color", source_color) + Flow.SINK: + $socket.material.set_shader_param("cable_color", sink_color) diff --git a/Actors/Objects/ElectricSocket/ElectricSocket.tscn b/Actors/Objects/ElectricSocket/ElectricSocket.tscn new file mode 100644 index 0000000..b5d1fdc --- /dev/null +++ b/Actors/Objects/ElectricSocket/ElectricSocket.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://Graphics/tgstation/socket.png" type="Texture" id=1] +[ext_resource path="res://Actors/Objects/ElectricSocket/ElectricSocket.gd" type="Script" id=2] + +[sub_resource type="Shader" id=4] +code = "shader_type canvas_item; +render_mode blend_mix; + +uniform vec4 cable_color: hint_color; + +void fragment() { + vec4 col = texture(TEXTURE, UV); + if (col.r/col.g > 2.) { + col.rgb = cable_color.rgb * length(col.rgb); + } + COLOR = col; +}" +custom_defines = "" + +[sub_resource type="ShaderMaterial" id=5] +shader = SubResource( 4 ) +shader_param/cable_color = Color( 0.0823529, 0.937255, 0.27451, 1 ) + +[sub_resource type="CircleShape2D" id=6] +radius = 12.0 + +[node name="ElectricSocket" type="Area2D"] +collision_layer = 4 +collision_mask = 2147483652 +script = ExtResource( 2 ) +direction = 1 +source_color = Color( 0.937255, 0.0823529, 0.0823529, 1 ) +sink_color = Color( 0.0901961, 0.533333, 0.960784, 1 ) + +[node name="socket" type="Sprite" parent="."] +material = SubResource( 5 ) +texture = ExtResource( 1 ) +centered = false +region_enabled = true +region_rect = Rect2( 0, 32, 32, 32 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 16, 16 ) +shape = SubResource( 6 ) diff --git a/Actors/Objects/PowerStorage/PowerStorage.gd b/Actors/Objects/PowerStorage/PowerStorage.gd index 8541640..ab1c562 100644 --- a/Actors/Objects/PowerStorage/PowerStorage.gd +++ b/Actors/Objects/PowerStorage/PowerStorage.gd @@ -2,13 +2,23 @@ extends StaticBody2D class_name GameObjectPowerStorage +const MAX_CHARGE = 5000.0 + var open = false +var attached = true onready var activationRange = $ActivationRange as ActivationRange +var current_charge = MAX_CHARGE + func _ready(): if not Engine.editor_hint: activationRange.visible = true +func _physics_process(delta): + if $PowerManager.wired: + if $PowerManager.DEBUG: + update() + func _input(event): if event is InputEventMouseButton and event.pressed and not is_inside and open: open = false @@ -36,3 +46,13 @@ func _force_close_ui(): if open: open = false $UIAnimation.play("fadeout") + +func _draw(): + if $PowerManager.DEBUG: + var charge_px = int(current_charge / MAX_CHARGE * 32) + var charge_color = Color.greenyellow + if charge_px < 20: + charge_color = Color.yellow + if charge_px < 10: + charge_color = Color.red + draw_rect(Rect2(32, 32-charge_px, 4, charge_px), charge_color) diff --git a/Actors/Objects/PowerStorage/PowerStorage.tscn b/Actors/Objects/PowerStorage/PowerStorage.tscn index 8f5997f..aa1edc7 100644 --- a/Actors/Objects/PowerStorage/PowerStorage.tscn +++ b/Actors/Objects/PowerStorage/PowerStorage.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://Actors/Objects/PowerStorage/PowerStorage.gd" type="Script" id=1] [ext_resource path="res://Graphics/tgstation/smes.png" type="Texture" id=2] [ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=3] [ext_resource path="res://Actors/Objects/PowerStorage/UI/PowerUI.tscn" type="PackedScene" id=4] +[ext_resource path="res://Actors/Components/PowerManager.gd" type="Script" id=5] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 16, 16 ) @@ -12,7 +13,7 @@ extents = Vector2( 16, 16 ) length = 0.2 step = 0.05 tracks/0/type = "value" -tracks/0/path = NodePath("Control:modulate") +tracks/0/path = NodePath("../StaticBody2D/Control:modulate") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false @@ -24,7 +25,7 @@ tracks/0/keys = { "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ] } tracks/1/type = "bezier" -tracks/1/path = NodePath("Control:position:y") +tracks/1/path = NodePath("../StaticBody2D/Control:position:y") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false @@ -37,7 +38,7 @@ tracks/1/keys = { [sub_resource type="Animation" id=3] length = 0.2 tracks/0/type = "value" -tracks/0/path = NodePath("Control:modulate") +tracks/0/path = NodePath("../StaticBody2D/Control:modulate") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false @@ -49,7 +50,7 @@ tracks/0/keys = { "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] } tracks/1/type = "bezier" -tracks/1/path = NodePath("Control:position:y") +tracks/1/path = NodePath("../StaticBody2D/Control:position:y") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false @@ -59,7 +60,7 @@ tracks/1/keys = { "times": PoolRealArray( 0, 0.2 ) } -[sub_resource type="CircleShape2D" id=4] +[sub_resource type="CircleShape2D" id=5] radius = 56.0 [node name="StaticBody2D" type="StaticBody2D"] @@ -78,6 +79,9 @@ centered = false anims/fadein = SubResource( 2 ) anims/fadeout = SubResource( 3 ) +[node name="PowerManager" type="Node" parent="."] +script = ExtResource( 5 ) + [node name="Control" type="Node2D" parent="."] position = Vector2( 16, 0 ) z_index = 999 @@ -96,7 +100,7 @@ position = Vector2( 16, 16 ) script = ExtResource( 3 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"] -shape = SubResource( 4 ) +shape = SubResource( 5 ) [connection signal="mouse_entered" from="Control/PowerUI" to="." method="_ui_focus_changed" binds= [ true ]] [connection signal="mouse_exited" from="Control/PowerUI" to="." method="_ui_focus_changed" binds= [ false ]] [connection signal="player_left" from="ActivationRange" to="." method="_force_close_ui"] diff --git a/Actors/Objects/Scanner/Scanner.tscn b/Actors/Objects/Scanner/Scanner.tscn index 841d29e..6953de7 100644 --- a/Actors/Objects/Scanner/Scanner.tscn +++ b/Actors/Objects/Scanner/Scanner.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://Graphics/tgstation/scanner.png" type="Texture" id=1] [ext_resource path="res://Actors/Objects/Scanner/Scanner.gd" type="Script" id=2] +[ext_resource path="res://Actors/Components/PowerManager.gd" type="Script" id=3] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 16, 16 ) @@ -17,3 +18,6 @@ shape = SubResource( 1 ) position = Vector2( -1, 0 ) texture = ExtResource( 1 ) centered = false + +[node name="PowerManager" type="Node" parent="."] +script = ExtResource( 3 ) diff --git a/Actors/Systems/Electricity/ElectricProbe.gd b/Actors/Systems/Electricity/ElectricProbe.gd new file mode 100644 index 0000000..80b5ef3 --- /dev/null +++ b/Actors/Systems/Electricity/ElectricProbe.gd @@ -0,0 +1,25 @@ +extends Area2D + +class_name ProbeElectric + +const DEBUG = true + +const center = Vector2.ONE * 16 + +var neighbours = [] + +func _physics_process(delta): + if DEBUG: + update() + +func _draw(): + if DEBUG: + draw_circle(center, 4, Color.cyan) + for neighbour in neighbours: + var delta = (neighbour.global_position - global_position) / global_scale + draw_line(center, delta + center, Color.cyan, 2) + +func _got_neighbour(area: Area2D): + if area == self: + return + neighbours.push_back(area) diff --git a/Actors/Systems/Electricity/ElectricProbe.tscn b/Actors/Systems/Electricity/ElectricProbe.tscn new file mode 100644 index 0000000..60358cd --- /dev/null +++ b/Actors/Systems/Electricity/ElectricProbe.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Actors/Systems/Electricity/ElectricProbe.gd" type="Script" id=1] + +[sub_resource type="CircleShape2D" id=1] +radius = 12.0 + +[sub_resource type="SegmentShape2D" id=2] +a = Vector2( 16, -16 ) +b = Vector2( 16, 48 ) + +[sub_resource type="SegmentShape2D" id=3] +a = Vector2( -16, 16 ) +b = Vector2( 48, 16 ) + +[node name="ElProbe" type="Area2D"] +collision_layer = 4 +collision_mask = 4 +script = ExtResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 16, 16 ) +shape = SubResource( 1 ) + +[node name="NeighbourCheck" type="Area2D" parent="."] +input_pickable = false +monitorable = false +collision_layer = 4 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="NeighbourCheck"] +shape = SubResource( 2 ) + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="NeighbourCheck"] +shape = SubResource( 3 ) +[connection signal="area_entered" from="NeighbourCheck" to="." method="_got_neighbour"] diff --git a/Actors/Systems/Electricity/Electricity.gd b/Actors/Systems/Electricity/Electricity.gd new file mode 100644 index 0000000..61510e1 --- /dev/null +++ b/Actors/Systems/Electricity/Electricity.gd @@ -0,0 +1 @@ +extends Node diff --git a/Graphics/tgstation/cables.tres b/Graphics/tgstation/cables.tres index ccbe6c5..2be7241 100644 --- a/Graphics/tgstation/cables.tres +++ b/Graphics/tgstation/cables.tres @@ -3,7 +3,7 @@ [ext_resource path="res://Graphics/tgstation/wires-l2.png" type="Texture" id=1] [resource] -0/name = "wires-l2.png 0" +0/name = "Wire" 0/texture = ExtResource( 1 ) 0/tex_offset = Vector2( 0, 0 ) 0/modulate = Color( 1, 1, 1, 1 ) diff --git a/Graphics/tgstation/socket.png b/Graphics/tgstation/socket.png new file mode 100644 index 0000000000000000000000000000000000000000..c9dd93e4409f320eaac72e2df934603834c9bba6 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Up!qLLn`LHopq4+kbwZp_NI{O zQg=GLJ?txYEq~nDz#mcfBqBL&$>cxLGd4eMasFjEOT@M7UR9<*0|Sc!10#n615?%O zrJc?fPyOw#i&`F--8(VLG=A$fi}RbKZ!*pKd7ghm?(N&ZrZI%?+spi}rkefE&u@G? zKEIVMcz)aZ!MW}C55KE<`&+JGece4P->cTIorKHd%4hHRiq85knCzrX+V z?$5)MJ~Ca)vbFh+icDTO@n($nck{#AtEWz9NNe8wzTu6s!C$@;c1)MwH-vuP$?Eq0 n;Th$G|Md;UcJI%zgH7p>zI1$T)Ix9N6(FvstDnm{r-UW|395p1 literal 0 HcmV?d00001 diff --git a/Graphics/tgstation/socket.png.import b/Graphics/tgstation/socket.png.import new file mode 100644 index 0000000..c3979ca --- /dev/null +++ b/Graphics/tgstation/socket.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/socket.png-6a3c65f9b84aa2e36705290607e8f31f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/tgstation/socket.png" +dest_files=[ "res://.import/socket.png-6a3c65f9b84aa2e36705290607e8f31f.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Graphics/tgstation/wires-l2.png.import b/Graphics/tgstation/wires-l2.png.import index 782bb0d..7db2215 100644 --- a/Graphics/tgstation/wires-l2.png.import +++ b/Graphics/tgstation/wires-l2.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Scenes/Game.tscn b/Scenes/Game.tscn index 3321996..ea019bb 100644 --- a/Scenes/Game.tscn +++ b/Scenes/Game.tscn @@ -20,7 +20,6 @@ map_path = NodePath("runtime") [node name="runtime" parent="world" instance=ExtResource( 7 )] [node name="odyssey" parent="world" instance=ExtResource( 1 )] -visible = false [node name="player" parent="world" instance=ExtResource( 2 )] position = Vector2( 206.017, 250.966 ) diff --git a/Scenes/Map.gd b/Scenes/Map.gd index b9bf3df..a86226e 100644 --- a/Scenes/Map.gd +++ b/Scenes/Map.gd @@ -13,26 +13,29 @@ const SPEED_EASE = 0.5 const DIRECTION_EASE = 0.5 const EPSILON = 0.01 -var tilemaps = [] +const ProbeElectricity = preload("res://Actors/Systems/Electricity/ElectricProbe.tscn") + +onready var tilemaps = [ $base, $cables, $floor, $walls ] export var unlit = false setget set_unlit onready var darkness = $darkness +export var shadow_intensity = 0.2 + func _ready(): if Engine.editor_hint: return $editor.queue_free() set_unlit(false) + + # Electricity setup + make_electric_probes($cables, "Wire") -func set_unlit(val): - unlit = val - if darkness: - darkness.visible = not val - -func _process(delta): +func _process(delta: float): if Engine.editor_hint: return + # Ease ship speed/direction changes if abs(ship_direction - current_ship_direction) < EPSILON: current_ship_direction = ship_direction else: @@ -45,9 +48,28 @@ func _process(delta): $deepspace.rotation = current_ship_direction-PI/2 $deepspace.region_rect.position += Vector2(sin(current_ship_direction), cos(current_ship_direction)) * current_ship_speed * delta +# Lighting + +func set_unlit(val: bool): + unlit = val + if darkness: + darkness.visible = not val + +# Engine related functions + func set_engine_strength(val: float): # Set energy strength to current speed for child in $engines.get_children(): if child is GameObjectEngine: var engine = child as GameObjectEngine engine.strength = val + +# Tileset related functions + +func make_electric_probes(tilemap: TileMap, tile_name: String): + var tile_id = tilemap.tile_set.find_tile_by_name(tile_name) + for cell in tilemap.get_used_cells_by_id(tile_id): + var coord = tilemap.map_to_world(cell) + var probe = ProbeElectricity.instance() + probe.position = coord + tilemap.add_child(probe) diff --git a/Scenes/Maps/odyssey.tscn b/Scenes/Maps/odyssey.tscn index 71efd39..e840cf4 100644 --- a/Scenes/Maps/odyssey.tscn +++ b/Scenes/Maps/odyssey.tscn @@ -41,18 +41,13 @@ cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 tile_data = PoolIntArray( -589821, 0, 0, -589820, 0, 0, -589819, 0, 0, -458763, 0, 0, -458762, 0, 0, -458761, 0, 0, -458760, 0, 0, -458759, 0, 0, -458758, 0, 0, -458757, 0, 0, -458755, 0, 0, -458754, 0, 0, -458753, 0, 0, -524288, 0, 0, -524287, 0, 0, -524286, 0, 0, -524285, 0, 0, -524284, 0, 0, -524283, 0, 0, -524282, 0, 0, -524281, 0, 0, -524280, 0, 0, -524279, 0, 0, -524278, 0, 0, -393227, 0, 0, -393226, 0, 0, -393225, 0, 0, -393224, 0, 0, -393223, 0, 0, -393222, 0, 0, -393221, 0, 0, -393220, 0, 0, -393219, 0, 0, -393218, 0, 0, -393217, 0, 0, -458752, 0, 0, -458751, 0, 0, -458750, 0, 0, -458749, 0, 0, -458748, 0, 0, -458747, 0, 0, -458746, 0, 0, -458745, 0, 0, -458744, 0, 0, -458743, 0, 0, -458742, 0, 0, -458741, 0, 0, -327691, 0, 0, -327690, 0, 0, -327689, 0, 0, -327688, 0, 0, -327687, 0, 0, -327686, 0, 0, -327685, 0, 0, -327684, 0, 0, -327683, 0, 0, -327682, 0, 0, -327681, 0, 0, -393216, 0, 0, -393215, 0, 0, -393214, 0, 0, -393213, 0, 0, -393212, 0, 0, -393211, 0, 0, -393210, 0, 0, -393209, 0, 0, -393208, 0, 0, -393207, 0, 0, -393206, 0, 0, -393205, 0, 0, -262155, 0, 0, -262154, 0, 0, -262153, 0, 0, -262152, 0, 0, -262151, 0, 0, -262150, 0, 0, -262149, 0, 0, -262148, 0, 0, -262147, 0, 0, -262146, 0, 0, -262145, 0, 0, -327680, 0, 0, -327679, 0, 0, -327678, 0, 0, -327677, 0, 0, -327676, 0, 0, -327675, 0, 0, -327674, 0, 0, -327673, 0, 0, -327672, 0, 0, -327671, 0, 0, -327670, 0, 0, -327669, 0, 0, -196619, 0, 0, -196618, 0, 0, -196617, 0, 0, -196616, 0, 0, -196615, 0, 0, -196614, 0, 0, -196613, 0, 0, -196612, 0, 0, -196611, 0, 0, -196610, 0, 0, -196609, 0, 0, -262144, 0, 0, -262143, 0, 0, -262142, 0, 0, -262141, 0, 0, -262140, 0, 0, -262139, 0, 0, -262138, 0, 0, -262137, 0, 0, -262136, 0, 0, -262135, 0, 0, -262134, 0, 0, -262133, 0, 0, -131083, 0, 0, -131082, 0, 0, -131081, 0, 0, -131080, 0, 0, -131079, 0, 0, -131078, 0, 0, -131077, 0, 0, -131076, 0, 0, -131075, 0, 0, -131074, 0, 0, -131073, 0, 0, -196608, 0, 0, -196607, 0, 0, -196606, 0, 0, -196605, 0, 0, -196604, 0, 0, -196603, 0, 0, -196602, 0, 0, -196601, 0, 0, -196600, 0, 0, -196599, 0, 0, -196598, 0, 0, -196597, 0, 0, -65547, 0, 0, -65546, 0, 0, -65545, 0, 0, -65544, 0, 0, -65543, 0, 0, -65542, 0, 0, -65541, 0, 0, -65540, 0, 0, -65539, 0, 0, -65538, 0, 0, -65537, 0, 0, -131072, 0, 0, -131071, 0, 0, -131070, 0, 0, -131069, 0, 0, -131068, 0, 0, -131067, 0, 0, -131066, 0, 0, -131065, 0, 0, -131064, 0, 0, -131063, 0, 0, -131062, 0, 0, -131061, 0, 0, -11, 0, 0, -10, 0, 0, -9, 0, 0, -8, 0, 0, -7, 0, 0, -6, 0, 0, -5, 0, 0, -2, 0, 0, -1, 0, 0, -65536, 0, 0, -65535, 0, 0, -65534, 0, 0, -65533, 0, 0, -65532, 0, 0, -65531, 0, 0, -65530, 0, 0, -65529, 0, 0, -65528, 0, 0, -65527, 0, 0, -65526, 0, 0, 5, 0, 0, 6, 0, 0, 7, 0, 0, 65541, 0, 0, 65542, 0, 0, 65543, 0, 0, 131077, 0, 0, 131078, 0, 0, 131079, 0, 0, 262137, 0, 0, 262138, 0, 0, 262139, 0, 0, 262140, 0, 0, 262141, 0, 0, 262142, 0, 0, 262143, 0, 0, 196608, 0, 0, 196609, 0, 0, 196610, 0, 0, 196611, 0, 0, 196612, 0, 0, 196613, 0, 0, 196614, 0, 0, 196615, 0, 0, 196616, 0, 0, 196617, 0, 0, 196618, 0, 0, 196619, 0, 0, 196620, 0, 0, 196621, 0, 0, 196622, 0, 0, 196623, 0, 0, 196624, 0, 0, 196625, 0, 0, 196626, 0, 0, 196627, 0, 0, 327673, 0, 0, 327674, 0, 0, 327675, 0, 0, 327676, 0, 0, 327677, 0, 0, 327678, 0, 0, 327679, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 262149, 0, 0, 262150, 0, 0, 262151, 0, 0, 262152, 0, 0, 262153, 0, 0, 262154, 0, 0, 262155, 0, 0, 262156, 0, 0, 262157, 0, 0, 262158, 0, 0, 262159, 0, 0, 262160, 0, 0, 262161, 0, 0, 262162, 0, 0, 262163, 0, 0, 393209, 0, 0, 393210, 0, 0, 393211, 0, 0, 393212, 0, 0, 393213, 0, 0, 393214, 0, 0, 393215, 0, 0, 327680, 0, 0, 327681, 0, 0, 327682, 0, 0, 327683, 0, 0, 327684, 0, 0, 327685, 0, 0, 327686, 0, 0, 327687, 0, 0, 327688, 0, 0, 327689, 0, 0, 327690, 0, 0, 327691, 0, 0, 327692, 0, 0, 327693, 0, 0, 327694, 0, 0, 327695, 0, 0, 327696, 0, 0, 327697, 0, 0, 327698, 0, 0, 327699, 0, 0, 458740, 0, 0, 458741, 0, 0, 458742, 0, 0, 458743, 0, 0, 458744, 0, 0, 458745, 0, 0, 458746, 0, 0, 458747, 0, 0, 458748, 0, 0, 458749, 0, 0, 458750, 0, 0, 458751, 0, 0, 393216, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0, 393223, 0, 0, 393224, 0, 0, 393225, 0, 0, 393226, 0, 0, 393227, 0, 0, 393228, 0, 0, 393229, 0, 0, 393230, 0, 0, 393231, 0, 0, 393232, 0, 0, 393233, 0, 0, 393234, 0, 0, 393235, 0, 0, 524276, 0, 0, 524277, 0, 0, 524278, 0, 0, 524279, 0, 0, 524280, 0, 0, 524281, 0, 0, 524282, 0, 0, 524283, 0, 0, 524284, 0, 0, 524285, 0, 0, 524286, 0, 0, 524287, 0, 0, 458752, 0, 0, 458753, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 458758, 0, 0, 458759, 0, 0, 458760, 0, 0, 458761, 0, 0, 458762, 0, 0, 458763, 0, 0, 458764, 0, 0, 458765, 0, 0, 458766, 0, 0, 458767, 0, 0, 458768, 0, 0, 458769, 0, 0, 458770, 0, 0, 458771, 0, 0, 589812, 0, 0, 589813, 0, 0, 589814, 0, 0, 589815, 0, 0, 589816, 0, 0, 589817, 0, 0, 589818, 0, 0, 589819, 0, 0, 589820, 0, 0, 589821, 0, 0, 589822, 0, 0, 589823, 0, 0, 524288, 0, 0, 524289, 0, 0, 524290, 0, 0, 524291, 0, 0, 524292, 0, 0, 524293, 0, 0, 524294, 0, 0, 524295, 0, 0, 524296, 0, 0, 524297, 0, 0, 524298, 0, 0, 524299, 0, 0, 524300, 0, 0, 524301, 0, 0, 524302, 0, 0, 524303, 0, 0, 524304, 0, 0, 524305, 0, 0, 524306, 0, 0, 524307, 0, 0, 655348, 0, 0, 655349, 0, 0, 655350, 0, 0, 655351, 0, 0, 655352, 0, 0, 655353, 0, 0, 655354, 0, 0, 655355, 0, 0, 655356, 0, 0, 655357, 0, 0, 655358, 0, 0, 655359, 0, 0, 589824, 0, 0, 589825, 0, 0, 589826, 0, 0, 589827, 0, 0, 589828, 0, 0, 589829, 0, 0, 589830, 0, 0, 589831, 0, 0, 589832, 0, 0, 589833, 0, 0, 589834, 0, 0, 589835, 0, 0, 589836, 0, 0, 589837, 0, 0, 589838, 0, 0, 589839, 0, 0, 589840, 0, 0, 589841, 0, 0, 589842, 0, 0, 589843, 0, 0, 720889, 0, 0, 720890, 0, 0, 720891, 0, 0, 720892, 0, 0, 720893, 0, 0, 720894, 0, 0, 720895, 0, 0, 655360, 0, 0, 655361, 0, 0, 655362, 0, 0, 655363, 0, 0, 655364, 0, 0, 655365, 0, 0, 655366, 0, 0, 655367, 0, 0, 655368, 0, 0, 655369, 0, 0, 655370, 0, 0, 655371, 0, 0, 655372, 0, 0, 655373, 0, 0, 655374, 0, 0, 655375, 0, 0, 655376, 0, 0, 655377, 0, 0, 655378, 0, 0, 655379, 0, 0, 786425, 0, 0, 786426, 0, 0, 786427, 0, 0, 786428, 0, 0, 786429, 0, 0, 786430, 0, 0, 786431, 0, 0, 720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720912, 0, 0, 720913, 0, 0, 720914, 0, 0, 720915, 0, 0, 851961, 0, 0, 851962, 0, 0, 851963, 0, 0, 851964, 0, 0, 851965, 0, 0, 851966, 0, 0, 851967, 0, 0, 786432, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 786449, 0, 0, 786450, 0, 0, 786451, 0, 0, 851973, 0, 0, 851974, 0, 0, 851975, 0, 0, 917509, 0, 0, 917510, 0, 0, 917511, 0, 0, 983045, 0, 0, 983046, 0, 0, 983047, 0, 0, 1114101, 0, 0, 1114102, 0, 0, 1114103, 0, 0, 1114104, 0, 0, 1114105, 0, 0, 1114106, 0, 0, 1114107, 0, 0, 1114110, 0, 0, 1114111, 0, 0, 1048576, 0, 0, 1048577, 0, 0, 1048578, 0, 0, 1048579, 0, 0, 1048580, 0, 0, 1048581, 0, 0, 1048582, 0, 0, 1048583, 0, 0, 1048584, 0, 0, 1048585, 0, 0, 1048586, 0, 0, 1179637, 0, 0, 1179638, 0, 0, 1179639, 0, 0, 1179640, 0, 0, 1179641, 0, 0, 1179642, 0, 0, 1179643, 0, 0, 1179644, 0, 0, 1179645, 0, 0, 1179646, 0, 0, 1179647, 0, 0, 1114112, 0, 0, 1114113, 0, 0, 1114114, 0, 0, 1114115, 0, 0, 1114116, 0, 0, 1114117, 0, 0, 1114118, 0, 0, 1114119, 0, 0, 1114120, 0, 0, 1114121, 0, 0, 1114122, 0, 0, 1114123, 0, 0, 1245174, 0, 0, 1245175, 0, 0, 1245176, 0, 0, 1245177, 0, 0, 1245178, 0, 0, 1245179, 0, 0, 1245180, 0, 0, 1245181, 0, 0, 1245182, 0, 0, 1245183, 0, 0, 1179648, 0, 0, 1179649, 0, 0, 1179650, 0, 0, 1179651, 0, 0, 1179652, 0, 0, 1179653, 0, 0, 1179654, 0, 0, 1179655, 0, 0, 1179656, 0, 0, 1179657, 0, 0, 1179658, 0, 0, 1179659, 0, 0, 1310710, 0, 0, 1310711, 0, 0, 1310712, 0, 0, 1310713, 0, 0, 1310714, 0, 0, 1310715, 0, 0, 1310716, 0, 0, 1310717, 0, 0, 1310718, 0, 0, 1310719, 0, 0, 1245184, 0, 0, 1245185, 0, 0, 1245186, 0, 0, 1245187, 0, 0, 1245188, 0, 0, 1245189, 0, 0, 1245190, 0, 0, 1245191, 0, 0, 1245192, 0, 0, 1245193, 0, 0, 1245194, 0, 0, 1245195, 0, 0, 1376246, 0, 0, 1376247, 0, 0, 1376248, 0, 0, 1376249, 0, 0, 1376250, 0, 0, 1376251, 0, 0, 1376252, 0, 0, 1376253, 0, 0, 1376254, 0, 0, 1376255, 0, 0, 1310720, 0, 0, 1310721, 0, 0, 1310722, 0, 0, 1310723, 0, 0, 1310724, 0, 0, 1310725, 0, 0, 1310726, 0, 0, 1310727, 0, 0, 1310728, 0, 0, 1310729, 0, 0, 1310730, 0, 0, 1310731, 0, 0, 1441782, 0, 0, 1441783, 0, 0, 1441784, 0, 0, 1441785, 0, 0, 1441786, 0, 0, 1441787, 0, 0, 1441788, 0, 0, 1441789, 0, 0, 1441790, 0, 0, 1441791, 0, 0, 1376256, 0, 0, 1376257, 0, 0, 1376258, 0, 0, 1376259, 0, 0, 1376260, 0, 0, 1376261, 0, 0, 1376262, 0, 0, 1376263, 0, 0, 1376264, 0, 0, 1376265, 0, 0, 1376266, 0, 0, 1376267, 0, 0, 1507317, 0, 0, 1507318, 0, 0, 1507319, 0, 0, 1507320, 0, 0, 1507321, 0, 0, 1507322, 0, 0, 1507323, 0, 0, 1507324, 0, 0, 1507325, 0, 0, 1507326, 0, 0, 1507327, 0, 0, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441799, 0, 0, 1441800, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1572853, 0, 0, 1572854, 0, 0, 1572855, 0, 0, 1572856, 0, 0, 1572857, 0, 0, 1572858, 0, 0, 1572859, 0, 0, 1572862, 0, 0, 1572863, 0, 0, 1507328, 0, 0, 1507329, 0, 0, 1507330, 0, 0, 1507331, 0, 0, 1507332, 0, 0, 1507333, 0, 0, 1507334, 0, 0, 1507335, 0, 0, 1507336, 0, 0, 1507337, 0, 0, 1507338, 0, 0 ) -script = ExtResource( 3 ) -extended_tilemap_node = NodePath("../1x1") [node name="cables" type="TileMap" parent="."] -visible = false tile_set = ExtResource( 1 ) cell_size = Vector2( 32, 32 ) cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 -script = ExtResource( 3 ) -extended_tilemap_node = NodePath("../1x1") [node name="floor" type="TileMap" parent="."] tile_set = ExtResource( 9 ) @@ -61,8 +56,6 @@ cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 tile_data = PoolIntArray( -589820, 1, 0, -524284, 1, 0, -393226, 1, 0, -393225, 1, 0, -393224, 1, 0, -393223, 1, 0, -393222, 1, 0, -393217, 1, 0, -458752, 1, 0, -458751, 1, 0, -458750, 1, 0, -458748, 1, 0, -458746, 1, 0, -458745, 1, 0, -458744, 1, 0, -458743, 1, 0, -327690, 1, 0, -327689, 1, 0, -327688, 1, 0, -327687, 1, 0, -327686, 1, 0, -327685, 1, 0, -327684, 1, 0, -327683, 1, 0, -327682, 1, 0, -327681, 1, 0, -393216, 1, 0, -393215, 1, 0, -393214, 1, 0, -393213, 1, 0, -393212, 1, 0, -393211, 1, 0, -393210, 1, 0, -393209, 1, 0, -393208, 1, 0, -393207, 1, 0, -393206, 1, 0, -262154, 1, 0, -262153, 1, 0, -262152, 1, 0, -262151, 1, 0, -262150, 1, 0, -262149, 1, 0, -262148, 1, 0, -262147, 1, 0, -262146, 1, 0, -262145, 1, 0, -327680, 1, 0, -327679, 1, 0, -327678, 1, 0, -327677, 1, 0, -327676, 1, 0, -327675, 1, 0, -327674, 1, 0, -327673, 1, 0, -327672, 1, 0, -327671, 1, 0, -327670, 1, 0, -196618, 1, 0, -196617, 1, 0, -196616, 1, 0, -196615, 1, 0, -196614, 1, 0, -196613, 1, 0, -196612, 1, 0, -196611, 1, 0, -196610, 1, 0, -196609, 1, 0, -262144, 1, 0, -262143, 1, 0, -262142, 1, 0, -262141, 1, 0, -262140, 1, 0, -262139, 1, 0, -262138, 1, 0, -262137, 1, 0, -262136, 1, 0, -262135, 1, 0, -262134, 1, 0, -131082, 1, 0, -131081, 1, 0, -131080, 1, 0, -131079, 1, 0, -131078, 1, 0, -131077, 1, 0, -131076, 1, 0, -131075, 1, 0, -131074, 1, 0, -131073, 1, 0, -196608, 1, 0, -196607, 1, 0, -196606, 1, 0, -196605, 1, 0, -196604, 1, 0, -196603, 1, 0, -196602, 1, 0, -196601, 1, 0, -196600, 1, 0, -196599, 1, 0, -196598, 1, 0, -65546, 1, 0, -65545, 1, 0, -65544, 1, 0, -65543, 1, 0, -65542, 1, 0, -65537, 1, 0, -131072, 1, 0, -131071, 1, 0, -131070, 1, 0, -131069, 1, 0, -131068, 1, 0, -131067, 1, 0, -131066, 1, 0, -131065, 1, 0, -131064, 1, 0, -131063, 1, 0, -65530, 1, 0, 6, 1, 0, 65542, 1, 0, 131078, 1, 0, 196614, 1, 0, 327674, 1, 0, 327675, 1, 0, 327676, 1, 0, 327677, 1, 0, 327678, 1, 0, 262144, 1, 0, 262145, 1, 0, 262146, 1, 0, 262147, 1, 0, 262148, 1, 0, 262149, 1, 0, 262150, 1, 0, 262151, 1, 0, 262152, 1, 0, 262153, 1, 0, 262154, 1, 0, 262155, 1, 0, 262156, 1, 0, 262158, 1, 0, 262159, 1, 0, 262160, 1, 0, 262161, 1, 0, 262162, 1, 0, 393210, 1, 0, 393211, 1, 0, 393212, 1, 0, 393213, 1, 0, 393214, 1, 0, 327680, 1, 0, 327681, 1, 0, 327682, 1, 0, 327683, 1, 0, 327684, 1, 0, 327685, 1, 0, 327686, 1, 0, 327687, 1, 0, 327688, 1, 0, 327689, 1, 0, 327690, 1, 0, 327691, 1, 0, 327692, 1, 0, 327694, 1, 0, 327695, 1, 0, 327696, 1, 0, 327697, 1, 0, 327698, 1, 0, 458746, 1, 0, 458747, 1, 0, 458748, 1, 0, 458749, 1, 0, 458750, 1, 0, 458751, 1, 0, 393216, 1, 0, 393217, 1, 0, 393218, 1, 0, 393219, 1, 0, 393220, 1, 0, 393221, 1, 0, 393222, 1, 0, 393223, 1, 0, 393224, 1, 0, 393225, 1, 0, 393226, 1, 0, 393227, 1, 0, 393228, 1, 0, 393229, 1, 0, 393230, 1, 0, 393231, 1, 0, 393232, 1, 0, 393233, 1, 0, 393234, 1, 0, 524277, 1, 0, 524278, 1, 0, 524279, 1, 0, 524280, 1, 0, 524281, 1, 0, 524282, 1, 0, 524283, 1, 0, 524284, 1, 0, 524285, 1, 0, 524286, 1, 0, 458752, 1, 0, 458753, 1, 0, 458754, 1, 0, 458755, 1, 0, 458756, 1, 0, 458757, 1, 0, 458758, 1, 0, 458759, 1, 0, 458760, 1, 0, 458761, 1, 0, 458762, 1, 0, 458763, 1, 0, 458764, 1, 0, 458766, 1, 0, 458767, 1, 0, 458768, 1, 0, 458769, 1, 0, 458770, 1, 0, 589813, 1, 0, 589814, 1, 0, 589815, 1, 0, 589816, 1, 0, 589817, 1, 0, 589818, 1, 0, 589819, 1, 0, 589820, 1, 0, 589821, 1, 0, 589822, 1, 0, 524288, 1, 0, 524289, 1, 0, 524290, 1, 0, 524291, 1, 0, 524292, 1, 0, 524293, 1, 0, 524294, 1, 0, 524295, 1, 0, 524296, 1, 0, 524297, 1, 0, 524298, 1, 0, 524299, 1, 0, 524300, 1, 0, 524302, 1, 0, 524303, 1, 0, 524304, 1, 0, 524305, 1, 0, 524306, 1, 0, 655354, 1, 0, 655355, 1, 0, 655356, 1, 0, 655357, 1, 0, 655358, 1, 0, 655359, 1, 0, 589824, 1, 0, 589825, 1, 0, 589826, 1, 0, 589827, 1, 0, 589828, 1, 0, 589829, 1, 0, 589830, 1, 0, 589831, 1, 0, 589832, 1, 0, 589833, 1, 0, 589834, 1, 0, 589835, 1, 0, 589836, 1, 0, 589837, 1, 0, 589838, 1, 0, 589839, 1, 0, 589840, 1, 0, 589841, 1, 0, 589842, 1, 0, 720890, 1, 0, 720891, 1, 0, 720892, 1, 0, 720893, 1, 0, 720894, 1, 0, 655360, 1, 0, 655361, 1, 0, 655362, 1, 0, 655363, 1, 0, 655364, 1, 0, 655365, 1, 0, 655366, 1, 0, 655367, 1, 0, 655368, 1, 0, 655369, 1, 0, 655370, 1, 0, 655371, 1, 0, 655372, 1, 0, 655374, 1, 0, 655375, 1, 0, 655376, 1, 0, 655377, 1, 0, 655378, 1, 0, 786426, 1, 0, 786427, 1, 0, 786428, 1, 0, 786429, 1, 0, 786430, 1, 0, 720896, 1, 0, 720897, 1, 0, 720898, 1, 0, 720899, 1, 0, 720900, 1, 0, 720901, 1, 0, 720902, 1, 0, 720903, 1, 0, 720904, 1, 0, 720905, 1, 0, 720906, 1, 0, 720907, 1, 0, 720908, 1, 0, 720910, 1, 0, 720911, 1, 0, 720912, 1, 0, 720913, 1, 0, 720914, 1, 0, 786438, 1, 0, 851974, 1, 0, 917510, 1, 0, 983046, 1, 0, 1048582, 1, 0, 1179638, 1, 0, 1179639, 1, 0, 1179640, 1, 0, 1179641, 1, 0, 1179642, 1, 0, 1179647, 1, 0, 1114112, 1, 0, 1114113, 1, 0, 1114114, 1, 0, 1114115, 1, 0, 1114116, 1, 0, 1114117, 1, 0, 1114118, 1, 0, 1114119, 1, 0, 1114120, 1, 0, 1114121, 1, 0, 1245174, 1, 0, 1245175, 1, 0, 1245176, 1, 0, 1245177, 1, 0, 1245178, 1, 0, 1245179, 1, 0, 1245180, 1, 0, 1245181, 1, 0, 1245182, 1, 0, 1245183, 1, 0, 1179648, 1, 0, 1179649, 1, 0, 1179650, 1, 0, 1179651, 1, 0, 1179652, 1, 0, 1179653, 1, 0, 1179654, 1, 0, 1179655, 1, 0, 1179656, 1, 0, 1179657, 1, 0, 1179658, 1, 0, 1310710, 1, 0, 1310711, 1, 0, 1310712, 1, 0, 1310713, 1, 0, 1310714, 1, 0, 1310719, 1, 0, 1245184, 1, 0, 1245185, 1, 0, 1245186, 1, 0, 1245187, 1, 0, 1245188, 1, 0, 1245189, 1, 0, 1245190, 1, 0, 1245191, 1, 0, 1245192, 1, 0, 1245193, 1, 0, 1245194, 1, 0, 1376246, 1, 0, 1376247, 1, 0, 1376248, 1, 0, 1376249, 1, 0, 1376250, 1, 0, 1376255, 1, 0, 1310720, 1, 0, 1310721, 1, 0, 1310722, 1, 0, 1310723, 1, 0, 1310724, 1, 0, 1310725, 1, 0, 1310726, 1, 0, 1310727, 1, 0, 1310728, 1, 0, 1310729, 1, 0, 1310730, 1, 0, 1441782, 1, 0, 1441783, 1, 0, 1441784, 1, 0, 1441785, 1, 0, 1441786, 1, 0, 1441787, 1, 0, 1441788, 1, 0, 1441789, 1, 0, 1441790, 1, 0, 1441791, 1, 0, 1376256, 1, 0, 1376257, 1, 0, 1376258, 1, 0, 1376259, 1, 0, 1376260, 1, 0, 1376261, 1, 0, 1376262, 1, 0, 1376263, 1, 0, 1376264, 1, 0, 1376265, 1, 0, 1376266, 1, 0, 1507318, 1, 0, 1507319, 1, 0, 1507320, 1, 0, 1507321, 1, 0, 1507322, 1, 0, 1507327, 1, 0, 1441792, 1, 0, 1441793, 1, 0, 1441794, 1, 0, 1441795, 1, 0, 1441796, 1, 0, 1441797, 1, 0, 1441798, 1, 0, 1441799, 1, 0, 1441800, 1, 0, 1441801, 1, 0 ) -script = ExtResource( 3 ) -extended_tilemap_node = NodePath("../1x1") [node name="walls" type="TileMap" parent="."] tile_set = ExtResource( 1 ) diff --git a/Scenes/Maps/runtime.gd b/Scenes/Maps/runtime.gd index fafd7aa..eff4d79 100644 --- a/Scenes/Maps/runtime.gd +++ b/Scenes/Maps/runtime.gd @@ -1,10 +1,4 @@ extends GameMap func _ready(): - tilemaps = [ - $base, - $cables, - $floor, - $walls - ] set_unlit(true) diff --git a/Scenes/Maps/runtime.tscn b/Scenes/Maps/runtime.tscn index bc5f2cf..650c89a 100644 --- a/Scenes/Maps/runtime.tscn +++ b/Scenes/Maps/runtime.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://Graphics/tgstation/walls.tres" type="TileSet" id=1] [ext_resource path="res://Graphics/tgstation/1x1.tres" type="TileSet" id=2] @@ -12,12 +12,12 @@ [ext_resource path="res://Actors/Objects/Engine/Engine.tscn" type="PackedScene" id=10] [ext_resource path="res://Graphics/tgstation/base.tres" type="TileSet" id=11] [ext_resource path="res://Actors/Objects/PowerStorage/PowerStorage.tscn" type="PackedScene" id=12] +[ext_resource path="res://Actors/Objects/ElectricSocket/ElectricSocket.tscn" type="PackedScene" id=13] [sub_resource type="CanvasItemMaterial" id=1] light_mode = 1 [node name="map" type="Node2D"] -position = Vector2( -1, 0 ) script = ExtResource( 5 ) [node name="darkness" type="CanvasModulate" parent="."] @@ -43,19 +43,14 @@ cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 tile_data = PoolIntArray( 262137, 0, 0, 262138, 0, 0, 262139, 0, 0, 262140, 0, 0, 262141, 0, 0, 262142, 0, 0, 262143, 0, 0, 196608, 0, 0, 196609, 0, 0, 196610, 0, 0, 196611, 0, 0, 196612, 0, 0, 196613, 0, 0, 196614, 0, 0, 196615, 0, 0, 196616, 0, 0, 196617, 0, 0, 196618, 0, 0, 196619, 0, 0, 196620, 0, 0, 196621, 0, 0, 196622, 0, 0, 196623, 0, 0, 196624, 0, 0, 196625, 0, 0, 196626, 0, 0, 196627, 0, 0, 327673, 0, 0, 327674, 0, 0, 327675, 0, 0, 327676, 0, 0, 327677, 0, 0, 327678, 0, 0, 327679, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 262149, 0, 0, 262150, 0, 0, 262151, 0, 0, 262152, 0, 0, 262153, 0, 0, 262154, 0, 0, 262155, 0, 0, 262156, 0, 0, 262157, 0, 0, 262158, 0, 0, 262159, 0, 0, 262160, 0, 0, 262161, 0, 0, 262162, 0, 0, 262163, 0, 0, 393209, 0, 0, 393210, 0, 0, 393211, 0, 0, 393212, 0, 0, 393213, 0, 0, 393214, 0, 0, 393215, 0, 0, 327680, 0, 0, 327681, 0, 0, 327682, 0, 0, 327683, 0, 0, 327684, 0, 0, 327685, 0, 0, 327686, 0, 0, 327687, 0, 0, 327688, 0, 0, 327689, 0, 0, 327690, 0, 0, 327691, 0, 0, 327692, 0, 0, 327693, 0, 0, 327694, 0, 0, 327695, 0, 0, 327696, 0, 0, 327697, 0, 0, 327698, 0, 0, 327699, 0, 0, 458745, 0, 0, 458746, 0, 0, 458747, 0, 0, 458748, 0, 0, 458749, 0, 0, 458750, 0, 0, 458751, 0, 0, 393216, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0, 393223, 0, 0, 393224, 0, 0, 393225, 0, 0, 393226, 0, 0, 393227, 0, 0, 393228, 0, 0, 393229, 0, 0, 393230, 0, 0, 393231, 0, 0, 393232, 0, 0, 393233, 0, 0, 393234, 0, 0, 393235, 0, 0, 524281, 0, 0, 524282, 0, 0, 524283, 0, 0, 524284, 0, 0, 524285, 0, 0, 524286, 0, 0, 524287, 0, 0, 458752, 0, 0, 458753, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 458758, 0, 0, 458759, 0, 0, 458760, 0, 0, 458761, 0, 0, 458762, 0, 0, 458763, 0, 0, 458764, 0, 0, 458765, 0, 0, 458766, 0, 0, 458767, 0, 0, 458768, 0, 0, 458769, 0, 0, 458770, 0, 0, 458771, 0, 0, 589817, 0, 0, 589818, 0, 0, 589819, 0, 0, 589820, 0, 0, 589821, 0, 0, 589822, 0, 0, 589823, 0, 0, 524288, 0, 0, 524289, 0, 0, 524290, 0, 0, 524291, 0, 0, 524292, 0, 0, 524293, 0, 0, 524294, 0, 0, 524295, 0, 0, 524296, 0, 0, 524297, 0, 0, 524298, 0, 0, 524299, 0, 0, 524300, 0, 0, 524301, 0, 0, 524302, 0, 0, 524303, 0, 0, 524304, 0, 0, 524305, 0, 0, 524306, 0, 0, 524307, 0, 0, 655353, 0, 0, 655354, 0, 0, 655355, 0, 0, 655356, 0, 0, 655357, 0, 0, 655358, 0, 0, 655359, 0, 0, 589824, 0, 0, 589825, 0, 0, 589826, 0, 0, 589827, 0, 0, 589828, 0, 0, 589829, 0, 0, 589830, 0, 0, 589831, 0, 0, 589832, 0, 0, 589833, 0, 0, 589834, 0, 0, 589835, 0, 0, 589836, 0, 0, 589837, 0, 0, 589838, 0, 0, 589839, 0, 0, 589840, 0, 0, 589841, 0, 0, 589842, 0, 0, 589843, 0, 0, 720889, 0, 0, 720890, 0, 0, 720891, 0, 0, 720892, 0, 0, 720893, 0, 0, 720894, 0, 0, 720895, 0, 0, 655360, 0, 0, 655361, 0, 0, 655362, 0, 0, 655363, 0, 0, 655364, 0, 0, 655365, 0, 0, 655366, 0, 0, 655367, 0, 0, 655368, 0, 0, 655369, 0, 0, 655370, 0, 0, 655371, 0, 0, 655372, 0, 0, 655373, 0, 0, 655374, 0, 0, 655375, 0, 0, 655376, 0, 0, 655377, 0, 0, 655378, 0, 0, 655379, 0, 0, 786425, 0, 0, 786426, 0, 0, 786427, 0, 0, 786428, 0, 0, 786429, 0, 0, 786430, 0, 0, 786431, 0, 0, 720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720912, 0, 0, 720913, 0, 0, 720914, 0, 0, 720915, 0, 0, 851961, 0, 0, 851962, 0, 0, 851963, 0, 0, 851964, 0, 0, 851965, 0, 0, 851966, 0, 0, 851967, 0, 0, 786432, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 786449, 0, 0, 786450, 0, 0, 786451, 0, 0 ) -script = ExtResource( 3 ) -extended_tilemap_node = NodePath("../1x1") [node name="cables" type="TileMap" parent="."] -position = Vector2( -3, 0 ) tile_set = ExtResource( 4 ) cell_size = Vector2( 32, 32 ) cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 -tile_data = PoolIntArray( 524286, 0, 131072, 524287, 0, 65536, 458752, 0, 65536, 458753, 0, 65536, 458754, 0, 65536, 458755, 0, 196608, 524291, 0, 65539, 655355, 0, 131073, 589827, 0, 65539, 720891, 0, 65539, 655363, 0, 131075, 786427, 0, 65538, 786428, 0, 65536, 786429, 0, 262144 ) -script = ExtResource( 3 ) -extended_tilemap_node = NodePath("../1x1") +tile_data = PoolIntArray( 393214, 0, 327681, 393215, 0, 262145, 327680, 0, 458752, 458749, 0, 65537, 458750, 0, 262150, 458751, 0, 458754, 393216, 0, 393218, 524284, 0, 327681, 524285, 0, 131078, 524287, 0, 262151, 458752, 0, 458755, 458755, 0, 131072, 458756, 0, 0, 589820, 0, 262151, 589821, 0, 6, 589822, 0, 1, 589823, 0, 196611, 655355, 0, 131072, 655356, 0, 131074, 655358, 0, 65539, 589828, 0, 131073, 720892, 0, 65538, 720893, 0, 1, 720894, 0, 2, 720895, 0, 262144, 655363, 0, 131072, 655364, 0, 2, 655365, 0, 65536, 655366, 0, 65536, 655367, 0, 1, 655368, 0, 262144, 786429, 0, 131075, 720903, 0, 131075 ) [node name="floor" type="TileMap" parent="."] tile_set = ExtResource( 9 ) @@ -63,8 +58,6 @@ cell_size = Vector2( 32, 32 ) cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 -script = ExtResource( 3 ) -extended_tilemap_node = NodePath("../1x1") [node name="walls" type="TileMap" parent="."] tile_set = ExtResource( 1 ) @@ -106,37 +99,50 @@ __meta__ = { } [node name="Computer" parent="objects" instance=ExtResource( 6 )] -position = Vector2( -32, 224 ) +position = Vector2( -64, 128 ) [node name="Computer2" parent="objects" instance=ExtResource( 6 )] -position = Vector2( 0, 224 ) +position = Vector2( -32, 128 ) computer_type = 1 [node name="Computer3" parent="objects" instance=ExtResource( 6 )] -position = Vector2( 32, 224 ) +position = Vector2( 0, 128 ) computer_type = 2 [node name="Computer4" parent="objects" instance=ExtResource( 6 )] -position = Vector2( 64, 224 ) +position = Vector2( 32, 128 ) computer_type = 3 [node name="Computer5" parent="objects" instance=ExtResource( 6 )] -position = Vector2( -64, 224 ) +position = Vector2( -96, 128 ) computer_type = 4 [node name="Computer6" parent="objects" instance=ExtResource( 6 )] -position = Vector2( -96, 224 ) +position = Vector2( -128, 128 ) computer_type = 5 +[node name="StaticBody2D2" parent="objects" instance=ExtResource( 12 )] +position = Vector2( 193, 128 ) + +[node name="SMES1" parent="objects" instance=ExtResource( 12 )] +position = Vector2( 128, 256 ) + [node name="Computer7" parent="objects" instance=ExtResource( 6 )] -position = Vector2( 96, 224 ) +position = Vector2( 64, 128 ) computer_type = 6 -[node name="StaticBody2D" parent="objects/Computer7" instance=ExtResource( 12 )] -position = Vector2( -255, 64 ) +[node name="Scanner" parent="objects" instance=ExtResource( 8 )] +position = Vector2( 288, 320 ) -[node name="StaticBody2D2" parent="objects/Computer7" instance=ExtResource( 12 )] -position = Vector2( 1, 96 ) +[node name="ElectricSocket" parent="objects" instance=ExtResource( 13 )] +position = Vector2( 128, 288 ) +direction = 2 +connections = [ NodePath("../SMES1") ] +flow = 0 + +[node name="ElectricSocket2" parent="objects" instance=ExtResource( 13 )] +position = Vector2( 256, 320 ) +connections = [ NodePath("../Scanner") ] [node name="lights" type="Node2D" parent="."] modulate = Color( 0.980392, 0.980392, 0.980392, 1 ) @@ -144,6 +150,3 @@ __meta__ = { "_edit_group_": true, "_edit_lock_": true } - -[node name="StaticBody2D" parent="." instance=ExtResource( 8 )] -position = Vector2( -95, 352 ) diff --git a/Scenes/Rendering/MapTiles.gd b/Scenes/Rendering/MapTiles.gd index 6e4f662..6b8aae7 100644 --- a/Scenes/Rendering/MapTiles.gd +++ b/Scenes/Rendering/MapTiles.gd @@ -3,6 +3,7 @@ extends TileMap class_name MapTiles export(NodePath) var extended_tilemap_node + export var occluders = ["Wall"] export var shadow_intensity = 0.2 @@ -10,12 +11,13 @@ export var shadow_intensity = 0.2 onready var extended_tilemap = get_node(extended_tilemap_node) as TileMap func _ready(): - # Make occluders for FOV + # Make occluders make_occluders() - + # Convert 2x2 tiles to 1x1 if possible convert_extended() + func convert_extended(): var extended = extended_tilemap.tile_set for id in tile_set.get_tiles_ids(): @@ -39,7 +41,9 @@ func convert_extended(): func make_occluders(): var occluder_ids = [] for occluder_name in occluders: - occluder_ids.push_back(tile_set.find_tile_by_name(occluder_name)) + var id = tile_set.find_tile_by_name(occluder_name) + if id >= 0: + occluder_ids.push_back(id) for id in tile_set.get_tiles_ids(): if occluder_ids.find(id) < 0: # Not an occluder, skip it diff --git a/Scenes/World.gd b/Scenes/World.gd index 97cf827..0876e8d 100644 --- a/Scenes/World.gd +++ b/Scenes/World.gd @@ -10,4 +10,5 @@ onready var map = get_node(map_path) as GameMap func _ready(): for tilemap in map.tilemaps: - tilemap.set_occluder_origin(player) + if tilemap is MapTiles: + tilemap.set_occluder_origin(player) diff --git a/project.godot b/project.godot index 4dbbe54..aaa1d87 100644 --- a/project.godot +++ b/project.godot @@ -74,6 +74,16 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://Scenes/Rendering/Occluder.gd" }, { +"base": "Node", +"class": "PowerManager", +"language": "GDScript", +"path": "res://Actors/Components/PowerManager.gd" +}, { +"base": "Area2D", +"class": "ProbeElectric", +"language": "GDScript", +"path": "res://Actors/Systems/Electricity/ElectricProbe.gd" +}, { "base": "Reference", "class": "UICommand", "language": "GDScript", @@ -93,6 +103,8 @@ _global_script_class_icons={ "GameWorld": "", "MapTiles": "", "Occluder": "", +"PowerManager": "", +"ProbeElectric": "", "UICommand": "" } @@ -152,6 +164,12 @@ sprint={ ] } +[layer_names] + +2d_physics/layer_1="Environment" +2d_physics/layer_2="Projectile" +2d_physics/layer_3="Electric" + [rendering] vram_compression/import_etc=true