Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1711 committed Feb 5, 2024
1 parent a47b7c3 commit dd7c822
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ texture = ExtResource("2_h6e5i")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-2.5, 0)
scale = Vector2(0.278716, 0.27712)
shape = SubResource("RectangleShape2D_cn71r")

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
8 changes: 4 additions & 4 deletions prototypes/game-shadows-of-surveillance/characters/drone.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

[sub_resource type="CircleShape2D" id="CircleShape2D_kvhpb"]

[sub_resource type="Image" id="Image_7r4yi"]
[sub_resource type="Image" id="Image_0m4ch"]
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",
Expand All @@ -21,7 +21,7 @@ data = {
}

[sub_resource type="ImageTexture" id="ImageTexture_1i6xe"]
image = SubResource("Image_7r4yi")
image = SubResource("Image_0m4ch")

[sub_resource type="GDScript" id="GDScript_6kxwn"]
script/source = "@tool
Expand Down Expand Up @@ -113,7 +113,7 @@ deferred = false
enabled = true
trigger = ""
[sub_resource type="Image" id="Image_6rsyd"]
[sub_resource type="Image" id="Image_1u8y2"]
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",
Expand All @@ -123,7 +123,7 @@ data = {
}
[sub_resource type="ImageTexture" id="ImageTexture_r1157"]
image = SubResource("Image_6rsyd")
image = SubResource("Image_1u8y2")
[node name="Enemy" type="CharacterBody2D" groups=["enemy"]]
position = Vector2(870, 309)
Expand Down
23 changes: 23 additions & 0 deletions prototypes/game-shadows-of-surveillance/characters/droneBullet.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
extends Area2D
var speed = 501
var dir
var muzzle

# Called when the node enters the scene tree for the first time.
func _ready():
self.global_position = muzzle
global_rotation = dir.angle()

func setup(direction, muzzlePos):
dir = direction
muzzle = muzzlePos

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position += dir * speed * delta

func _on_body_entered(body):
if body.is_in_group("player"):
body.queue_free()
if !body.is_in_group("enemy"):
queue_free()
13 changes: 6 additions & 7 deletions prototypes/game-shadows-of-surveillance/characters/player1.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
[ext_resource type="Texture2D" uid="uid://cfemjjj52u7tw" path="res://prototypes/game-shadows-of-surveillance/characters/Virtual Guy/Idle (32x32).png" id="1_am0mg"]
[ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/characters/PlatfomerControllerPlayer1.gd" id="2_opehh"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_h8f81"]
radius = 12.1039
height = 137.594
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7aa12"]
size = Vector2(17.84, 19.8482)

[node name="Player1" type="CharacterBody2D"]
[node name="Player1" type="CharacterBody2D" groups=["player"]]

[node name="DavidPlayer1" type="Sprite2D" parent="."]
position = Vector2(0, 4.76837e-07)
Expand All @@ -16,9 +15,9 @@ texture = ExtResource("1_am0mg")
hframes = 11

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 4)
scale = Vector2(0.912592, 0.18803)
shape = SubResource("CapsuleShape2D_h8f81")
position = Vector2(-5.96046e-07, 4.10018)
scale = Vector2(1.23053, 1.34308)
shape = SubResource("RectangleShape2D_7aa12")

[node name="PlatformerControllerPlayer1" type="Node2D" parent="."]
position = Vector2(576, 324)
Expand Down
11 changes: 6 additions & 5 deletions prototypes/game-shadows-of-surveillance/characters/player2.tscn
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[gd_scene load_steps=5 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://ch6w3mr4w7ueu" path="res://LightSprite.png" id="4_u5jrv"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_7cbuj"]
height = 248.062
[sub_resource type="RectangleShape2D" id="RectangleShape2D_csvif"]

[node name="Player2" type="CharacterBody2D" groups=["player"]]
scale = Vector2(0.258, 0.258)
collision_layer = 3
script = ExtResource("1_dxuki")

[node name="OlePlayer2" type="Sprite2D" parent="."]
scale = Vector2(1, 1.10562)
Expand All @@ -19,8 +20,8 @@ frame = 10

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 3.87597)
scale = Vector2(1, 0.11)
shape = SubResource("CapsuleShape2D_7cbuj")
scale = Vector2(1.12791, 1.45493)
shape = SubResource("RectangleShape2D_csvif")

[node name="Marker2D" type="Marker2D" parent="."]

Expand Down
2 changes: 1 addition & 1 deletion prototypes/game-shadows-of-surveillance/levels/level.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ color = Color(1, 1, 0.0313726, 1)
sprite_texture = ExtResource("4_rqfal")
placeholder_size = Vector2(20, 20)

[node name="Player1" parent="." groups=["player"] instance=ExtResource("3_x2hlg")]
[node name="Player1" parent="." instance=ExtResource("3_x2hlg")]
position = Vector2(101, 565)
scale = Vector2(1.5, 1.5)
collision_layer = 3
Expand Down
4 changes: 4 additions & 0 deletions prototypes/game-shadows-of-surveillance/levels/level2.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ scale = Vector2(3.5, 3.5)
texture = ExtResource("1_j6sv0")

[node name="CanvasModulate" type="CanvasModulate" parent="6" groups=["dark"]]
visible = false
color = Color(0, 0, 0, 1)

[node name="TileMap" parent="." instance=ExtResource("2_llo4g")]
Expand All @@ -26,3 +27,6 @@ position = Vector2(932, -32)
[node name="Player2" parent="." instance=ExtResource("5_a7n2h")]
position = Vector2(294, 440)
scale = Vector2(1.5, 1.5)

[node name="drone" parent="." instance=ExtResource("4_m1bym")]
position = Vector2(236, -6)
Binary file modified prototypes/game-shadows-of-surveillance/levels/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 25 additions & 14 deletions prototypes/game-shadows-of-surveillance/scripts/drone.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ extends CharacterBody2D

const SPEED = 300.0
const JUMP_VELOCITY = -400.0
const shootingCooldown = 3
const shootingCooldown = 2
const bullet_scene = preload("res://prototypes/game-shadows-of-surveillance/characters/droneBullet.tscn")
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
var player
var shootingTimer = 0
var minimalHeightDiff = 100

func _ready():
player = get_parent().get_node("Player1")
print(player)

pass

func _physics_process(delta):
player = get_parent().get_node("Player2")

# Add the gravity.
if not is_on_floor():
velocity.y += gravity * delta
Expand All @@ -25,24 +27,33 @@ func _physics_process(delta):

# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction = Input.get_axis("ui_left", "ui_right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)


if player:
var heightDifference = player.position.y - position.y
print(heightDifference)
if heightDifference < minimalHeightDiff:
velocity.y = -130
minimalHeightDiff = 200
else:
minimalHeightDiff = 100
var direction = Input.get_axis("ui_left", "ui_right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)

if player:
l var distanceToPlayer = position.distance_to(player.position)
print(distanceToPlayer)
if distanceToPlayer > 200:
var distanceToPlayer = position.distance_to(player.position)
if distanceToPlayer > 200:
shootingTimer += delta
if shootingTimer > shootingCooldown:
shoot()
shootingTimer = 0
print("shoot")
move_and_slide()

func shoot():
var b = bullet_scene.instantiate()
var direction = (get_global_mouse_position() - global_position).normalized()
var direction = (player.global_position - global_position).normalized()
b.setup(direction, $Marker2D.global_position)
owner.add_child(b)
2 changes: 1 addition & 1 deletion prototypes/game-shadows-of-surveillance/scripts/player2.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends CharacterBody2D

const bullet_scene = preload("res://prototypes/game-shadows-of-surveillance/characters/bullet.tscn")
const SPEED = 300.0
const SPEED = 200.0
const JUMP_VELOCITY = -400.0

# Get the gravity from the project settings to be synced with RigidBody nodes.
Expand Down

0 comments on commit dd7c822

Please sign in to comment.