From 166bf997ef5e40a2559b5e2652df5419eddebea8 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 7 Jul 2020 13:01:12 +0200 Subject: [PATCH] Switch to gles3, add engines --- Actors/Objects/Computer/Computer.gd | 2 + Actors/Objects/Door/Door.gd | 2 + Actors/Objects/Engine/Engine.gd | 56 +++++++++++++++++++++++ Actors/Objects/Engine/Engine.tscn | 40 ++++++++++++++++ Actors/Objects/Lightbulb/Lightbulb.gd | 6 ++- Actors/Objects/Lightbulb/Lightbulb.tscn | 7 +-- Graphics/tgstation/2x2.tres | 4 +- Graphics/tgstation/engine-big.png | Bin 0 -> 8576 bytes Graphics/tgstation/engine-big.png.import | 34 ++++++++++++++ Graphics/unshaded_mat.tres | 1 + Scenes/Map.gd | 14 ++++-- Scenes/Maps/odyssey.tscn | 54 ++++++++++++++++++---- project.godot | 25 +++++++++- 13 files changed, 221 insertions(+), 24 deletions(-) create mode 100644 Actors/Objects/Engine/Engine.gd create mode 100644 Actors/Objects/Engine/Engine.tscn create mode 100644 Graphics/tgstation/engine-big.png create mode 100644 Graphics/tgstation/engine-big.png.import diff --git a/Actors/Objects/Computer/Computer.gd b/Actors/Objects/Computer/Computer.gd index 18b24b9..e93dd9e 100644 --- a/Actors/Objects/Computer/Computer.gd +++ b/Actors/Objects/Computer/Computer.gd @@ -2,6 +2,8 @@ tool extends StaticBody2D +class_name GameObjectComputer + enum Direction { LEFT, RIGHT, UP, DOWN } enum ComputerType { ShipCommand, Comms, Medical, Research, ShipEngine, Atmos } diff --git a/Actors/Objects/Door/Door.gd b/Actors/Objects/Door/Door.gd index feb9c64..0cf020e 100644 --- a/Actors/Objects/Door/Door.gd +++ b/Actors/Objects/Door/Door.gd @@ -1,5 +1,7 @@ extends StaticBody2D +class_name GameObjectDoor + onready var activationRange = $ActivationRange as ActivationRange signal changed(open) diff --git a/Actors/Objects/Engine/Engine.gd b/Actors/Objects/Engine/Engine.gd new file mode 100644 index 0000000..3d4d608 --- /dev/null +++ b/Actors/Objects/Engine/Engine.gd @@ -0,0 +1,56 @@ +tool + +extends StaticBody2D + +class_name GameObjectEngine + +const LIGHT_STRENGTH_MULT = 0.002 + +const MAX_ENERGY = 2 + +enum Direction { LEFT, RIGHT, UP, DOWN } + +export(Direction) var direction = Direction.DOWN setget set_direction + +onready var activationRange = $ActivationRange as ActivationRange + +export var strength = 1.0 setget set_strength + +func _ready(): + if not Engine.editor_hint: + activationRange.visible = true + +func set_direction(dir): + direction = dir + refresh_sprite() + +func set_strength(val): + strength = val + $Light2D.energy = val * LIGHT_STRENGTH_MULT + +func refresh_sprite(): + var rot = 0 + match direction: + Direction.DOWN: + $engine.region_rect.position = Vector2(0, 0) + rot = 0 + Direction.UP: + $engine.region_rect.position = Vector2(0, 96) + rot = PI + Direction.LEFT: + $engine.region_rect.position = Vector2(96, 96) + rot = PI/2 + Direction.RIGHT: + $engine.region_rect.position = Vector2(96, 0) + rot = -PI/2 + $Light2D.rotation = rot + $ActivationRange.rotation = rot + + +func _input_event(viewport, event, shape_idx): + if Engine.editor_hint: + return + if event is InputEventMouseButton and event.pressed: + if activationRange.in_range(): + # TODO + pass diff --git a/Actors/Objects/Engine/Engine.tscn b/Actors/Objects/Engine/Engine.tscn new file mode 100644 index 0000000..b17761d --- /dev/null +++ b/Actors/Objects/Engine/Engine.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=1] +[ext_resource path="res://Actors/Objects/Engine/Engine.gd" type="Script" id=2] +[ext_resource path="res://Graphics/tgstation/engine-big.png" type="Texture" id=3] +[ext_resource path="res://Graphics/light_shadow_light.png" type="Texture" id=4] + +[sub_resource type="RectangleShape2D" id=2] +extents = Vector2( 48, 48 ) + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 72, 72 ) + +[node name="Engine" type="StaticBody2D"] +script = ExtResource( 2 ) + +[node name="engine" type="Sprite" parent="."] +texture = ExtResource( 3 ) +centered = false +region_enabled = true +region_rect = Rect2( 0, 0, 96, 96 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 48, 48 ) +shape = SubResource( 2 ) + +[node name="Light2D" type="Light2D" parent="."] +position = Vector2( 48, 48 ) +texture = ExtResource( 4 ) +offset = Vector2( 0, 50 ) +texture_scale = 2.0 +energy = 0.002 + +[node name="ActivationRange" type="Area2D" parent="."] +visible = false +script = ExtResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"] +position = Vector2( 48, 56 ) +shape = SubResource( 1 ) diff --git a/Actors/Objects/Lightbulb/Lightbulb.gd b/Actors/Objects/Lightbulb/Lightbulb.gd index 3244c82..dab51c8 100644 --- a/Actors/Objects/Lightbulb/Lightbulb.gd +++ b/Actors/Objects/Lightbulb/Lightbulb.gd @@ -2,6 +2,8 @@ tool extends Area2D +class_name GameObjectLightbulb + enum Direction { LEFT, RIGHT, UP, DOWN } export(Direction) var direction = Direction.DOWN setget set_direction @@ -36,10 +38,10 @@ func refresh_sprite(): rot = PI Direction.LEFT: $light.region_rect.position = Vector2(96, lit_offset) - rot = -PI/2 + rot = PI/2 Direction.RIGHT: $light.region_rect.position = Vector2(64, lit_offset) - rot = PI/2 + rot = -PI/2 $Light2D.rotation = rot $ActivationRange.rotation = rot diff --git a/Actors/Objects/Lightbulb/Lightbulb.tscn b/Actors/Objects/Lightbulb/Lightbulb.tscn index a46b2a1..17417f5 100644 --- a/Actors/Objects/Lightbulb/Lightbulb.tscn +++ b/Actors/Objects/Lightbulb/Lightbulb.tscn @@ -22,12 +22,9 @@ region_rect = Rect2( 32, 0, 32, 32 ) [node name="Light2D" type="Light2D" parent="."] texture = ExtResource( 1 ) offset = Vector2( 0, -10 ) -texture_scale = 4.0 +texture_scale = 3.5 energy = 1.2 -mode = 2 -shadow_enabled = true -shadow_gradient_length = 5.0 -shadow_filter = 5 +shadow_color = Color( 0, 0, 0, 1 ) shadow_filter_smooth = 10.0 __meta__ = { "_edit_group_": true, diff --git a/Graphics/tgstation/2x2.tres b/Graphics/tgstation/2x2.tres index a54bc18..ed179a1 100644 --- a/Graphics/tgstation/2x2.tres +++ b/Graphics/tgstation/2x2.tres @@ -1,9 +1,8 @@ -[gd_resource type="TileSet" load_steps=7 format=2] +[gd_resource type="TileSet" load_steps=6 format=2] [ext_resource path="res://Graphics/tgstation/floor.png" type="Texture" id=1] [ext_resource path="res://Graphics/tgstation/wall.png" type="Texture" id=2] [ext_resource path="res://Graphics/tgstation/window.png" type="Texture" id=3] -[ext_resource path="res://Graphics/unshaded_mat.tres" type="Material" id=4] [sub_resource type="ConvexPolygonShape2D" id=1] points = PoolVector2Array( 32, 32, 0, 32, 0, 0, 32, 0 ) @@ -50,7 +49,6 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 3/name = "Window" 3/texture = ExtResource( 3 ) 3/tex_offset = Vector2( 0, 0 ) -3/material = ExtResource( 4 ) 3/modulate = Color( 1, 1, 1, 1 ) 3/region = Rect2( 0, 0, 32, 32 ) 3/tile_mode = 0 diff --git a/Graphics/tgstation/engine-big.png b/Graphics/tgstation/engine-big.png new file mode 100644 index 0000000000000000000000000000000000000000..def8ce5c9e63271f879df423409b85c4a83b558a GIT binary patch literal 8576 zcmX|nc|6qH|NnWnKZml(mH+TO?Gr#_~psC~~hg+r;fQjWx2A z?X8q8hFhc*BMC)Dim}e`-TizYzdzoudCz<1%sFRXuh)4#U(a)H+8niBFQy;{09b!u zzr}I%75RM;38+2(;k*a{6mY=8+%7C>s4@gP&R_P6| z@y|A0sP-?*EAbKDQ_1KY`!zXv;Qid(rOw8P#pBgwu1yCAtG9m)9n=pM9#wq0I=Avz z1ZZF6I^+y?pN(uD7hiAjqPeDA3|Lp#JF}=)u5+vN!;^Rp^x~f3E*0C>fGmg_@;6C0 z8=pE+cxg7=DAFN)k`4teknId3{lQ^e8Y%F}=?!>Kb!00le8Yi{s>0i86*NtK&kH3=wuRn+)qV!XTIXMhqyg${GelOlg7UD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k^?2XK`V!jF4m|=vtDVm_+ zR1YCKv72Pzqq6933CeYEy2jk;TRZJ;Z^45KX@~lpKIdKFOrHQwR<#Ns!Cf{qGfx%8w>%z!`2?oajWRlRJW0i+WliRik(|3FxelPg<}F%p)ufGuCy_h z=uR~+97|64EQ9V!HAt663_=td9(KIIuAU9iT**4MS+&{0F-0I(2*OsQ^a#cq>8*Bt z22v=tOD>n_(bHur8ZDE)a4X(Ne~!_;+_XR7Y?7^_YjVPN43fkhja{|`>~(G*4+mrT zF@R3y`vy61D7v)`oUuAveJt{lYdY8Ho7l>`$ktk_69JtpBFtV{Y(p_~>qPPSXC&mA z>rN3ya{;S?MD|aPo_T!Wb}|lZo=|%1Zu{{Jp3;Hoo5=5iXu#06C()RBQ)M&X!7Hp0 zQ9toGGE}DR%%;8Q!2rnU_gMg`$2U)A)oforc4Xp#9wLgg;wUF~ewtOjxg>Khcr|{_ zP9BN-+fY^q-2&2B+5j|J2@^)@HU#>890#%49yu^M1g5sH>425{*$n_qi%n`L@n1bK zYo=C;@WC5Sf7k;d21TI z2lInUcV5}8iRr0I=g+2?2l@kTtlgB46pty}WMV~Y=FDL2xHT4n`Eu;k8MTm-KcOU# z*VrJINdK>h<>$L-^mP2Q_USgYuOCWi2xkvcMMJD5%uJoa#NzGuzKZ2v?44^rmR&Q3 my;N?!rAMZ9=yi=y(P@H;DF^(i_*P}*#8Hi>q!*= literal 0 HcmV?d00001 diff --git a/Graphics/tgstation/engine-big.png.import b/Graphics/tgstation/engine-big.png.import new file mode 100644 index 0000000..23d3902 --- /dev/null +++ b/Graphics/tgstation/engine-big.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/engine-big.png-ebd5beb5825a70f43b4d623b4878379e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/tgstation/engine-big.png" +dest_files=[ "res://.import/engine-big.png-ebd5beb5825a70f43b4d623b4878379e.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/unshaded_mat.tres b/Graphics/unshaded_mat.tres index 3e38d2d..9eb7e43 100644 --- a/Graphics/unshaded_mat.tres +++ b/Graphics/unshaded_mat.tres @@ -4,6 +4,7 @@ code = "shader_type canvas_item; render_mode unshaded;" +custom_defines = "" [resource] shader = SubResource( 1 ) diff --git a/Scenes/Map.gd b/Scenes/Map.gd index 926393c..1c19b7e 100644 --- a/Scenes/Map.gd +++ b/Scenes/Map.gd @@ -20,9 +20,9 @@ export var unlit = false setget set_unlit onready var darkness = $darkness func _ready(): - set_unlit(false) - if not Engine.editor_hint: - $editorDarkness.queue_free() + if Engine.editor_hint: + return + $editor.queue_free() func set_unlit(val): unlit = val @@ -41,5 +41,13 @@ func _process(delta): current_ship_speed = ship_speed else: current_ship_speed = lerp(current_ship_speed, ship_speed, delta * SPEED_EASE) + set_engine_strength(current_ship_speed) $deepspace.rotation = current_ship_direction-PI/2 $deepspace.region_rect.position += Vector2(sin(current_ship_direction), cos(current_ship_direction)) * current_ship_speed * delta + +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 = current_ship_speed diff --git a/Scenes/Maps/odyssey.tscn b/Scenes/Maps/odyssey.tscn index f6f2243..dc817ce 100644 --- a/Scenes/Maps/odyssey.tscn +++ b/Scenes/Maps/odyssey.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://Graphics/tgstation/2x2.tres" type="TileSet" id=1] [ext_resource path="res://Graphics/tgstation/1x1.tres" type="TileSet" id=2] @@ -9,6 +9,7 @@ [ext_resource path="res://Graphics/space.png" type="Texture" id=7] [ext_resource path="res://Actors/Objects/Lightbulb/Lightbulb.tscn" type="PackedScene" id=8] [ext_resource path="res://Graphics/white.png" type="Texture" id=9] +[ext_resource path="res://Actors/Objects/Engine/Engine.tscn" type="PackedScene" id=10] [sub_resource type="CanvasItemMaterial" id=1] light_mode = 1 @@ -18,16 +19,19 @@ script = ExtResource( 5 ) tilemap_path = NodePath("2x2") unlit = true -[node name="editorDarkness" type="CanvasModulate" parent="."] -visible = false +[node name="editor" type="Node2D" parent="."] + +[node name="editorLight" type="Light2D" parent="editor"] +position = Vector2( 80, 256 ) +scale = Vector2( 35, 10 ) +texture = ExtResource( 9 ) + +[node name="editorDarkness" type="CanvasModulate" parent="editor"] color = Color( 0, 0, 0, 1 ) -[node name="darkness" type="Node2D" parent="."] -visible = false - -[node name="Light2D" type="Light2D" parent="darkness"] -position = Vector2( 208, 256 ) -scale = Vector2( 27, 10 ) +[node name="darkness" type="Light2D" parent="."] +position = Vector2( 80, 256 ) +scale = Vector2( 35, 10 ) texture = ExtResource( 9 ) mode = 1 @@ -47,7 +51,7 @@ cell_size = Vector2( 32, 32 ) cell_quadrant_size = 32 occluder_light_mask = -2147483647 format = 1 -tile_data = PoolIntArray( 262137, 2, 0, 262138, 2, 0, 262139, 2, 0, 262140, 2, 0, 262141, 2, 0, 262142, 2, 0, 262143, 2, 0, 196608, 2, 0, 196609, 2, 0, 196610, 2, 0, 196611, 3, 0, 196612, 3, 0, 196613, 2, 0, 196614, 2, 0, 196615, 2, 0, 196616, 3, 0, 196617, 3, 0, 196618, 2, 0, 196619, 2, 0, 196620, 2, 0, 196621, 2, 0, 196622, 2, 0, 196623, 2, 0, 196624, 2, 0, 196625, 2, 0, 196626, 2, 0, 196627, 2, 0, 327673, 2, 0, 327674, 1, 0, 327675, 1, 0, 327676, 1, 0, 327677, 1, 0, 327678, 1, 0, 327679, 2, 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, 262157, 2, 0, 262158, 1, 0, 262159, 1, 0, 262160, 1, 0, 262161, 1, 0, 262162, 1, 0, 262163, 3, 0, 393209, 2, 0, 393210, 1, 0, 393211, 1, 0, 393212, 1, 0, 393213, 1, 0, 393214, 1, 0, 393215, 2, 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, 327693, 2, 0, 327694, 1, 0, 327695, 1, 0, 327696, 1, 0, 327697, 1, 0, 327698, 1, 0, 327699, 3, 0, 458745, 2, 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, 393235, 3, 0, 524281, 2, 0, 524282, 1, 0, 524283, 1, 0, 524284, 1, 0, 524285, 1, 0, 524286, 1, 0, 524287, 2, 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, 458765, 3, 0, 458766, 1, 0, 458767, 1, 0, 458768, 1, 0, 458769, 1, 0, 458770, 1, 0, 458771, 3, 0, 589817, 2, 0, 589818, 1, 0, 589819, 1, 0, 589820, 1, 0, 589821, 1, 0, 589822, 1, 0, 589823, 2, 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, 524301, 3, 0, 524302, 1, 0, 524303, 1, 0, 524304, 1, 0, 524305, 1, 0, 524306, 1, 0, 524307, 3, 0, 655353, 2, 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, 589843, 3, 0, 720889, 2, 0, 720890, 1, 0, 720891, 1, 0, 720892, 1, 0, 720893, 1, 0, 720894, 1, 0, 720895, 2, 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, 655373, 2, 0, 655374, 1, 0, 655375, 1, 0, 655376, 1, 0, 655377, 1, 0, 655378, 1, 0, 655379, 3, 0, 786425, 2, 0, 786426, 1, 0, 786427, 1, 0, 786428, 1, 0, 786429, 1, 0, 786430, 1, 0, 786431, 2, 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, 720909, 2, 0, 720910, 1, 0, 720911, 1, 0, 720912, 1, 0, 720913, 1, 0, 720914, 1, 0, 720915, 3, 0, 851961, 2, 0, 851962, 2, 0, 851963, 2, 0, 851964, 2, 0, 851965, 2, 0, 851966, 2, 0, 851967, 2, 0, 786432, 2, 0, 786433, 2, 0, 786434, 2, 0, 786435, 2, 0, 786436, 3, 0, 786437, 3, 0, 786438, 1, 0, 786439, 3, 0, 786440, 3, 0, 786441, 2, 0, 786442, 2, 0, 786443, 2, 0, 786444, 2, 0, 786445, 2, 0, 786446, 2, 0, 786447, 2, 0, 786448, 2, 0, 786449, 2, 0, 786450, 2, 0, 786451, 2, 0 ) +tile_data = PoolIntArray( 262137, 2, 0, 262138, 3, 0, 262139, 3, 0, 262140, 2, 0, 262141, 2, 0, 262142, 2, 0, 262143, 2, 0, 196608, 2, 0, 196609, 2, 0, 196610, 2, 0, 196611, 3, 0, 196612, 3, 0, 196613, 2, 0, 196614, 2, 0, 196615, 2, 0, 196616, 3, 0, 196617, 3, 0, 196618, 2, 0, 196619, 2, 0, 196620, 2, 0, 196621, 2, 0, 196622, 2, 0, 196623, 2, 0, 196624, 2, 0, 196625, 2, 0, 196626, 2, 0, 196627, 2, 0, 327673, 2, 0, 327674, 1, 0, 327675, 1, 0, 327676, 1, 0, 327677, 1, 0, 327678, 1, 0, 327679, 2, 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, 262157, 2, 0, 262158, 1, 0, 262159, 1, 0, 262160, 1, 0, 262161, 1, 0, 262162, 1, 0, 262163, 3, 0, 393209, 2, 0, 393210, 1, 0, 393211, 1, 0, 393212, 1, 0, 393213, 1, 0, 393214, 1, 0, 393215, 2, 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, 327693, 2, 0, 327694, 1, 0, 327695, 1, 0, 327696, 1, 0, 327697, 1, 0, 327698, 1, 0, 327699, 3, 0, 458740, 2, 0, 458741, 3, 0, 458742, 3, 0, 458743, 3, 0, 458744, 2, 0, 458745, 2, 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, 393235, 3, 0, 524276, 2, 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, 524287, 2, 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, 458765, 3, 0, 458766, 1, 0, 458767, 1, 0, 458768, 1, 0, 458769, 1, 0, 458770, 1, 0, 458771, 3, 0, 589812, 2, 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, 589823, 2, 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, 524301, 3, 0, 524302, 1, 0, 524303, 1, 0, 524304, 1, 0, 524305, 1, 0, 524306, 1, 0, 524307, 3, 0, 655348, 2, 0, 655349, 3, 0, 655350, 3, 0, 655351, 3, 0, 655352, 2, 0, 655353, 2, 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, 589843, 3, 0, 720889, 2, 0, 720890, 1, 0, 720891, 1, 0, 720892, 1, 0, 720893, 1, 0, 720894, 1, 0, 720895, 2, 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, 655373, 2, 0, 655374, 1, 0, 655375, 1, 0, 655376, 1, 0, 655377, 1, 0, 655378, 1, 0, 655379, 3, 0, 786425, 2, 0, 786426, 1, 0, 786427, 1, 0, 786428, 1, 0, 786429, 1, 0, 786430, 1, 0, 786431, 2, 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, 720909, 2, 0, 720910, 1, 0, 720911, 1, 0, 720912, 1, 0, 720913, 1, 0, 720914, 1, 0, 720915, 3, 0, 851961, 2, 0, 851962, 3, 0, 851963, 3, 0, 851964, 2, 0, 851965, 2, 0, 851966, 2, 0, 851967, 2, 0, 786432, 2, 0, 786433, 2, 0, 786434, 2, 0, 786435, 2, 0, 786436, 3, 0, 786437, 3, 0, 786438, 1, 0, 786439, 3, 0, 786440, 3, 0, 786441, 2, 0, 786442, 2, 0, 786443, 2, 0, 786444, 2, 0, 786445, 2, 0, 786446, 2, 0, 786447, 2, 0, 786448, 2, 0, 786449, 2, 0, 786450, 2, 0, 786451, 2, 0 ) script = ExtResource( 3 ) extended_tilemap_node = NodePath("../1x1") @@ -56,7 +60,29 @@ tile_set = ExtResource( 2 ) cell_size = Vector2( 16, 16 ) format = 1 +[node name="engines" type="Node2D" parent="."] +modulate = Color( 0.980392, 0.980392, 0.980392, 1 ) +__meta__ = { +"_edit_group_": true, +"_edit_lock_": true +} + +[node name="Engine" parent="engines" instance=ExtResource( 10 )] +position = Vector2( -320, 321 ) +direction = 0 + +[node name="Engine2" parent="engines" instance=ExtResource( 10 )] +position = Vector2( -480, 208 ) +direction = 0 + +[node name="Engine3" parent="engines" instance=ExtResource( 10 )] +position = Vector2( -320, 96 ) +direction = 0 + [node name="objects" type="Node2D" parent="."] +__meta__ = { +"_editor_description_": "" +} [node name="BridgeDoor" parent="objects" instance=ExtResource( 4 )] position = Vector2( 416, 192 ) @@ -83,6 +109,7 @@ direction = 0 computer_type = 1 [node name="lights" type="Node2D" parent="."] +modulate = Color( 0.980392, 0.980392, 0.980392, 1 ) __meta__ = { "_edit_group_": true, "_edit_lock_": true @@ -102,6 +129,13 @@ direction = 2 position = Vector2( 80, 368 ) direction = 2 +[node name="Lighttube7" parent="lights" instance=ExtResource( 8 )] +position = Vector2( -128, 144 ) + +[node name="Lighttube8" parent="lights" instance=ExtResource( 8 )] +position = Vector2( -128, 368 ) +direction = 2 + [node name="Lighttube5" parent="lights" instance=ExtResource( 8 )] position = Vector2( 528, 368 ) direction = 2 diff --git a/project.godot b/project.godot index 588cdc5..0405365 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,26 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://Scenes/Game.gd" }, { +"base": "StaticBody2D", +"class": "GameObjectComputer", +"language": "GDScript", +"path": "res://Actors/Objects/Computer/Computer.gd" +}, { +"base": "StaticBody2D", +"class": "GameObjectDoor", +"language": "GDScript", +"path": "res://Actors/Objects/Door/Door.gd" +}, { +"base": "StaticBody2D", +"class": "GameObjectEngine", +"language": "GDScript", +"path": "res://Actors/Objects/Engine/Engine.gd" +}, { +"base": "Area2D", +"class": "GameObjectLightbulb", +"language": "GDScript", +"path": "res://Actors/Objects/Lightbulb/Lightbulb.gd" +}, { "base": "Control", "class": "GameUI", "language": "GDScript", @@ -52,6 +72,10 @@ _global_script_classes=[ { _global_script_class_icons={ "ActivationRange": "", "GameInstance": "", +"GameObjectComputer": "", +"GameObjectDoor": "", +"GameObjectEngine": "", +"GameObjectLightbulb": "", "GameUI": "", "GameWorld": "", "Map": "", @@ -118,7 +142,6 @@ sprint={ [rendering] -quality/driver/driver_name="GLES2" vram_compression/import_etc=true vram_compression/import_etc2=false environment/default_clear_color=Color( 0, 0, 0, 1 )