diff --git a/addons/pronto/behaviors/CollisionBehavior.gd b/addons/pronto/behaviors/CollisionBehavior.gd index 5e46bbba..715b4b90 100644 --- a/addons/pronto/behaviors/CollisionBehavior.gd +++ b/addons/pronto/behaviors/CollisionBehavior.gd @@ -83,22 +83,17 @@ func _get_configuration_warnings(): return ["Collision only works with Area2D, RigidBody2D and CharacterBody2D"] return "" - -func toggleVisibility(node): - if node.visible: - node.hide() - else: - node.show() - func _on_area_2d_body_entered(body): var dark = get_tree().get_nodes_in_group("dark") print("dark:", dark) if dark: - toggleVisibility(dark[0]) + var canvasModulate = dark[0] + canvasModulate.hide() var light = get_tree().get_nodes_in_group("light") if light: - toggleVisibility(light[0]) + var flashlight = light[0] + flashlight.hide() #var canvasModulate = dark.get_node("CanvasModulate") #var canvasModulate = get_parent().get_parent().find_child("CanvasModulate") diff --git a/prototypes/game-shadows-of-surveillance/characters/drone.tscn b/prototypes/game-shadows-of-surveillance/characters/drone.tscn index 3d4cd86e..5093096a 100644 --- a/prototypes/game-shadows-of-surveillance/characters/drone.tscn +++ b/prototypes/game-shadows-of-surveillance/characters/drone.tscn @@ -11,11 +11,7 @@ [sub_resource type="CircleShape2D" id="CircleShape2D_kvhpb"] -<<<<<<< HEAD [sub_resource type="Image" id="Image_e2286"] -======= -[sub_resource type="Image" id="Image_laljb"] ->>>>>>> origin/game-shadows-of-surveillance data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 233, 233, 233, 23, 224, 224, 224, 198, 225, 225, 225, 199, 224, 224, 224, 24, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 233, 233, 233, 23, 224, 224, 224, 213, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 215, 224, 224, 224, 24, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 226, 226, 226, 103, 224, 224, 224, 255, 224, 224, 224, 212, 224, 224, 224, 209, 224, 224, 224, 255, 224, 224, 224, 107, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 226, 226, 226, 103, 232, 232, 232, 22, 230, 230, 230, 20, 224, 224, 224, 105, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 233, 233, 233, 23, 225, 225, 225, 109, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 107, 224, 224, 224, 24, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 233, 233, 233, 23, 224, 224, 224, 213, 224, 224, 224, 255, 225, 225, 225, 108, 255, 255, 255, 0, 225, 225, 225, 76, 224, 224, 224, 229, 224, 224, 224, 228, 224, 224, 224, 74, 255, 255, 255, 0, 224, 224, 224, 105, 224, 224, 224, 255, 225, 225, 225, 215, 224, 224, 224, 24, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 197, 224, 224, 224, 255, 224, 224, 224, 211, 231, 231, 231, 21, 255, 255, 255, 0, 224, 224, 224, 229, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 228, 255, 255, 255, 0, 230, 230, 230, 20, 224, 224, 224, 208, 224, 224, 224, 255, 224, 224, 224, 201, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 195, 224, 224, 224, 255, 225, 225, 225, 215, 224, 224, 224, 24, 255, 255, 255, 0, 224, 224, 224, 228, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 227, 255, 255, 255, 0, 233, 233, 233, 23, 224, 224, 224, 213, 224, 224, 224, 255, 224, 224, 224, 198, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 210, 224, 224, 224, 255, 224, 224, 224, 107, 255, 255, 255, 0, 224, 224, 224, 74, 224, 224, 224, 228, 224, 224, 224, 227, 224, 224, 224, 72, 255, 255, 255, 0, 226, 226, 226, 103, 224, 224, 224, 255, 224, 224, 224, 212, 232, 232, 232, 22, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 105, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 226, 226, 226, 103, 232, 232, 232, 22, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 107, 224, 224, 224, 24, 232, 232, 232, 22, 225, 225, 225, 109, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 105, 224, 224, 224, 255, 225, 225, 225, 215, 224, 224, 224, 211, 224, 224, 224, 255, 225, 225, 225, 108, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 210, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 212, 232, 232, 232, 22, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 194, 224, 224, 224, 196, 232, 232, 232, 22, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -25,11 +21,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_1i6xe"] -<<<<<<< HEAD image = SubResource("Image_e2286") -======= -image = SubResource("Image_laljb") ->>>>>>> origin/game-shadows-of-surveillance [sub_resource type="GDScript" id="GDScript_6kxwn"] script/source = "@tool @@ -121,11 +113,7 @@ deferred = false enabled = true trigger = "" -<<<<<<< HEAD [sub_resource type="Image" id="Image_6lp4v"] -======= -[sub_resource type="Image" id="Image_4gc6h"] ->>>>>>> origin/game-shadows-of-surveillance data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 160, 230, 230, 230, 10, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 213, 225, 225, 225, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 76, 224, 224, 224, 189, 224, 224, 224, 238, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 245, 224, 224, 224, 96, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 135, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 245, 226, 226, 226, 95, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 226, 226, 226, 77, 224, 224, 224, 255, 224, 224, 224, 253, 225, 225, 225, 117, 224, 224, 224, 32, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 212, 225, 225, 225, 42, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 129, 225, 225, 225, 68, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 189, 224, 224, 224, 255, 224, 224, 224, 113, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 159, 230, 230, 230, 10, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 73, 224, 224, 224, 255, 225, 225, 225, 183, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 242, 224, 224, 224, 255, 224, 224, 224, 24, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 25, 224, 224, 224, 255, 224, 224, 224, 237, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 243, 224, 224, 224, 254, 233, 233, 233, 23, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 229, 229, 229, 29, 224, 224, 224, 255, 224, 224, 224, 236, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 188, 224, 224, 224, 255, 225, 225, 225, 68, 255, 255, 255, 0, 255, 255, 255, 0, 230, 230, 230, 10, 224, 224, 224, 160, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 120, 224, 224, 224, 255, 224, 224, 224, 181, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 71, 225, 225, 225, 126, 255, 255, 255, 0, 255, 255, 255, 0, 226, 226, 226, 43, 224, 224, 224, 213, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 34, 225, 225, 225, 124, 224, 224, 224, 254, 224, 224, 224, 255, 226, 226, 226, 70, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 96, 224, 224, 224, 245, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 125, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 226, 226, 226, 95, 224, 224, 224, 245, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 237, 224, 224, 224, 185, 227, 227, 227, 71, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 225, 225, 225, 42, 224, 224, 224, 213, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 230, 230, 230, 10, 225, 225, 225, 159, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -135,11 +123,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_r1157"] -<<<<<<< HEAD image = SubResource("Image_6lp4v") -======= -image = SubResource("Image_4gc6h") ->>>>>>> origin/game-shadows-of-surveillance [node name="Enemy" type="CharacterBody2D" groups=["enemy"]] position = Vector2(870, 309) diff --git a/prototypes/game-shadows-of-surveillance/characters/droneBullet.gd b/prototypes/game-shadows-of-surveillance/characters/droneBullet.gd index 3378f4f2..7895a42b 100644 --- a/prototypes/game-shadows-of-surveillance/characters/droneBullet.gd +++ b/prototypes/game-shadows-of-surveillance/characters/droneBullet.gd @@ -17,14 +17,8 @@ func _process(delta): position += dir * speed * delta func _on_body_entered(body): - var playerHealth = get_parent().get_node("Player2").get_node("HealthBarBehavior") if body.is_in_group("player"): -<<<<<<< HEAD body.queue_free() get_tree().change_scene_to_file("res://Restart.tscn") -======= - if playerHealth: - playerHealth.damage(20) ->>>>>>> origin/game-shadows-of-surveillance if !body.is_in_group("enemy"): queue_free() diff --git a/prototypes/game-shadows-of-surveillance/characters/droneBullet.tscn b/prototypes/game-shadows-of-surveillance/characters/droneBullet.tscn index d8872262..f67ca2fa 100644 --- a/prototypes/game-shadows-of-surveillance/characters/droneBullet.tscn +++ b/prototypes/game-shadows-of-surveillance/characters/droneBullet.tscn @@ -1,15 +1,15 @@ [gd_scene load_steps=4 format=3 uid="uid://ci42negqibb6p"] -[ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/characters/droneBullet.gd" id="1_rjykv"] +[ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/characters/droneBullet.gd" id="1_u7oaw"] [ext_resource type="Texture2D" uid="uid://cooutieukq5fx" path="res://prototypes/game-shadows-of-surveillance/assets/laserRed01.png" id="2_uy31x"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_cn71r"] size = Vector2(57, 10) -[node name="Dronebullet" type="Area2D"] +[node name="Bullet" type="Area2D"] collision_layer = 2 collision_mask = 2 -script = ExtResource("1_rjykv") +script = ExtResource("1_u7oaw") [node name="Sprite2D" type="Sprite2D" parent="."] rotation = 1.5708 diff --git a/prototypes/game-shadows-of-surveillance/characters/player2.tscn b/prototypes/game-shadows-of-surveillance/characters/player2.tscn index 38cef949..bac442ae 100644 --- a/prototypes/game-shadows-of-surveillance/characters/player2.tscn +++ b/prototypes/game-shadows-of-surveillance/characters/player2.tscn @@ -1,45 +1,12 @@ -[gd_scene load_steps=13 format=3 uid="uid://dxp4mlvvs0g2"] +[gd_scene load_steps=6 format=3 uid="uid://dxp4mlvvs0g2"] [ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/scripts/player2.gd" id="1_dxuki"] [ext_resource type="Texture2D" uid="uid://dx884i5e2o8ql" path="res://prototypes/game-shadows-of-surveillance/characters/Pink Man/Idle (32x32).png" id="2_3wlyp"] [ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/characters/PlatformerControllerPlayer2.gd" id="3_kwpqc"] -[ext_resource type="Texture2D" uid="uid://ca3jyudumrgbl" path="res://LightSprite.png" id="4_u5jrv"] -[ext_resource type="Script" path="res://addons/pronto/behaviors/HealthBarBehavior.gd" id="5_oymb4"] -[ext_resource type="Script" path="res://addons/pronto/helpers/ConnectionScript.gd" id="6_82em1"] -[ext_resource type="Script" path="res://addons/pronto/helpers/Connection.gd" id="7_dkbr3"] +[ext_resource type="Texture2D" uid="uid://ch6w3mr4w7ueu" path="res://LightSprite.png" id="4_u5jrv"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_csvif"] -[sub_resource type="Gradient" id="Gradient_53jmr"] -offsets = PackedFloat32Array(0, 0.5, 1) -colors = PackedColorArray(1, 0, 0, 1, 1, 1, 0, 1, 0.196078, 0.803922, 0.196078, 1) - -[sub_resource type="GDScript" id="GDScript_1v478"] -script/source = "@tool -extends U -@warning_ignore(\"unused_parameter\") -func run(from: Node2D, to: CharacterBody2D): - return true -" - -[sub_resource type="Resource" id="Resource_v6c5t"] -script = ExtResource("6_82em1") -nested_script = SubResource("GDScript_1v478") -argument_names = ["from", "to"] -return_value = true - -[sub_resource type="Resource" id="Resource_xvx8k"] -script = ExtResource("7_dkbr3") -signal_name = "death" -to = NodePath("..") -more_references = [] -invoke = "die" -arguments = [] -only_if = SubResource("Resource_v6c5t") -deferred = false -enabled = true -trigger = "" - [node name="Player2" type="CharacterBody2D" groups=["player"]] scale = Vector2(0.258, 0.258) collision_layer = 3 @@ -65,9 +32,3 @@ texture = ExtResource("4_u5jrv") [node name="PlatformerControllerBehavior2" type="Node2D" parent="."] position = Vector2(576, 324) script = ExtResource("3_kwpqc") - -[node name="HealthBarBehavior" type="Node2D" parent="."] -position = Vector2(0, -11.6279) -script = ExtResource("5_oymb4") -progress_gradient = SubResource("Gradient_53jmr") -metadata/pronto_connections = [SubResource("Resource_xvx8k")] diff --git a/prototypes/game-shadows-of-surveillance/levels/level2.tscn b/prototypes/game-shadows-of-surveillance/levels/level2.tscn index 6954b95b..6c165c17 100644 --- a/prototypes/game-shadows-of-surveillance/levels/level2.tscn +++ b/prototypes/game-shadows-of-surveillance/levels/level2.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/levels/level2.gd" id="1_eq0v8"] [ext_resource type="Texture2D" uid="uid://ej3g6agmjf0x" path="res://prototypes/game-shadows-of-surveillance/assets/6.png" id="1_j6sv0"] -[ext_resource type="PackedScene" path="res://Tilemap.tscn" id="2_llo4g"] +[ext_resource type="PackedScene" uid="uid://4j52c4ucysq5" path="res://Tilemap.tscn" id="2_llo4g"] [ext_resource type="TileSet" uid="uid://dp12gfueqor5q" path="res://tileset.tres" id="3_ko4tt"] [ext_resource type="PackedScene" uid="uid://ds24wbrnr7tta" path="res://prototypes/game-shadows-of-surveillance/characters/drone.tscn" id="4_m1bym"] [ext_resource type="PackedScene" uid="uid://dxp4mlvvs0g2" path="res://prototypes/game-shadows-of-surveillance/characters/player2.tscn" id="5_a7n2h"] @@ -15,17 +15,19 @@ position = Vector2(578, 319) scale = Vector2(3.5, 3.5) texture = ExtResource("1_j6sv0") -[node name="CanvasModulate" type="CanvasModulate" parent="6" groups=["dark"]] [node name="Background_2" type="Sprite2D" parent="Background"] position = Vector2(576, 0) +scale = Vector2(1, 1) texture = ExtResource("1_j6sv0") [node name="Background_3" type="Sprite2D" parent="Background"] position = Vector2(1152, 0) +scale = Vector2(1, 1) texture = ExtResource("1_j6sv0") [node name="Background_4" type="Sprite2D" parent="Background/Background_3"] position = Vector2(575.714, 2.27374e-12) +scale = Vector2(1, 1) texture = ExtResource("1_j6sv0") [node name="CanvasModulate" type="CanvasModulate" parent="Background" groups=["dark"]] diff --git a/prototypes/game-shadows-of-surveillance/scripts/drone.gd b/prototypes/game-shadows-of-surveillance/scripts/drone.gd index 240c54ad..a6e3667d 100644 --- a/prototypes/game-shadows-of-surveillance/scripts/drone.gd +++ b/prototypes/game-shadows-of-surveillance/scripts/drone.gd @@ -20,6 +20,7 @@ func _physics_process(delta): # Add the gravity. if not is_on_floor(): velocity.y += gravity * delta + # Handle jump. if Input.is_action_just_pressed("ui_accept") and is_on_floor(): velocity.y = JUMP_VELOCITY @@ -29,10 +30,6 @@ func _physics_process(delta): if player: var heightDifference = player.position.y - position.y -<<<<<<< HEAD -======= - #print(heightDifference) ->>>>>>> origin/game-shadows-of-surveillance if heightDifference < minimalHeightDiff: velocity.y = -130 minimalHeightDiff = 200 diff --git a/prototypes/game-shadows-of-surveillance/scripts/player2.gd b/prototypes/game-shadows-of-surveillance/scripts/player2.gd index 5137a139..6f27e786 100644 --- a/prototypes/game-shadows-of-surveillance/scripts/player2.gd +++ b/prototypes/game-shadows-of-surveillance/scripts/player2.gd @@ -1,12 +1,13 @@ extends CharacterBody2D +const bullet_scene = preload("res://prototypes/game-shadows-of-surveillance/characters/bullet.tscn") const SPEED = 200.0 const JUMP_VELOCITY = -400.0 -var timeCapsule = false -const bullet_scene = preload("res://prototypes/game-shadows-of-surveillance/characters/bullet.tscn") + # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") + func _physics_process(delta): # Add the gravity. if not is_on_floor(): @@ -27,12 +28,10 @@ func _physics_process(delta): move_and_slide() - if Input.is_action_just_pressed("shoot") and timeCapsule: + if Input.is_action_just_pressed("shoot"): shoot() - -func die(): - queue_free() + func shoot(): var b = bullet_scene.instantiate() var direction = (get_global_mouse_position() - global_position).normalized()