diff --git a/project.godot b/project.godot index 5e962a7..641a0c6 100644 --- a/project.godot +++ b/project.godot @@ -20,6 +20,10 @@ Network="*res://source/assets/scripts/server_handlers/network_processors/network Global="*res://source/assets/scripts/server_handlers/global.gd" PersistentNodes="*res://source/scenes/OVERLAY/elements/persistent_nodes.tscn" +[debug] + +settings/stdout/print_fps=true + [display] window/size/width=1920 @@ -37,42 +41,42 @@ fps=false input_right={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) ] } input_left={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) ] } input_up={ "deadzone": 0.49, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) ] } input_down={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) ] } input_debug={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":96,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":96,"unicode":0,"echo":false,"script":null) ] } input_enter={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) ] } input_shift={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null) ] } input_shoot={ @@ -82,42 +86,42 @@ input_shoot={ } esc={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) ] } rotation_increase={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null) ] } rotation_decrease={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null) ] } line={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777351,"unicode":0,"echo":false,"script":null) ] } sine={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777352,"unicode":0,"echo":false,"script":null) ] } hyper={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777353,"unicode":0,"echo":false,"script":null) ] } parab={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777354,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777354,"unicode":0,"echo":false,"script":null) ] } shoot={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null) ] } diff --git a/source/entities/player/Gun_.gd b/source/assets/scripts/shooting/Gun_.gd similarity index 87% rename from source/entities/player/Gun_.gd rename to source/assets/scripts/shooting/Gun_.gd index fbf4151..5760fa9 100644 --- a/source/entities/player/Gun_.gd +++ b/source/assets/scripts/shooting/Gun_.gd @@ -3,7 +3,7 @@ extends AnimatedSprite var trajectory:String = 'line' var trajectory_line = 'sine' -var bullet = { +var bullet_env = { 'line' : preload("res://source/entities/shooting/Line_Trajectory/Line_Env.tscn"), 'sine' : preload("res://source/entities/shooting/Sine_Trajectory/Sine_Env.tscn"), 'parab' : preload("res://source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn"), @@ -31,10 +31,10 @@ func choose_trajectory(): func shoot(trajectory:String): - var b = bullet[trajectory].instance() - get_parent().get_parent().get_parent().add_child(b) - b.global_position = $Position2D.global_position - b.global_rotation = $Position2D.global_rotation + var bullet = bullet_env[trajectory].instance() + get_parent().get_parent().get_parent().add_child(bullet) + bullet.global_position = $Position2D.global_position + bullet.global_rotation = $Position2D.global_rotation pass func enable_trajectory_line(trajectory_line:String): diff --git a/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Barrel.gd b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Barrel.gd new file mode 100644 index 0000000..f5edb55 --- /dev/null +++ b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Barrel.gd @@ -0,0 +1,16 @@ +extends StaticBody2D # Y = aX + +onready var bullet_env = preload("res://source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Env.tscn") + + +func shoot(): + var bullet = bullet_env.instance() + get_parent().get_parent().get_parent().add_child(bullet) + bullet.global_position = $Position2D.global_position + bullet.global_rotation = $Position2D.global_rotation + + + +func _process(delta): + if Input.is_action_just_pressed("input_shoot"): + shoot() diff --git a/source/entities/shooting/script/Hyperbola/Hyperbolic_Bullet.gd b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd similarity index 81% rename from source/entities/shooting/script/Hyperbola/Hyperbolic_Bullet.gd rename to source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd index 69f7b2e..9949707 100644 --- a/source/entities/shooting/script/Hyperbola/Hyperbolic_Bullet.gd +++ b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd @@ -1,4 +1,4 @@ -extends Area2D +extends Sprite var velocity = Vector2() var speed = 1 @@ -9,7 +9,7 @@ var gravitile = 5 func follow_hyperbolic_trajectory(): velocity.x = gravitile * time - velocity.y = 1/time + velocity.y = 1 / time func _process(delta): @@ -18,7 +18,7 @@ func _process(delta): position += velocity * speed * delta -func _on_Bullet_body_entered(body): +func _on_hitbox_body_entered(body): if body.is_in_group("mobs"): body.queue_free() queue_free() diff --git a/source/entities/shooting/script/Hyperbola/Hyperbolic_Env.gd b/source/assets/scripts/shooting/Hyperbola/Hyperbolic_Env.gd similarity index 100% rename from source/entities/shooting/script/Hyperbola/Hyperbolic_Env.gd rename to source/assets/scripts/shooting/Hyperbola/Hyperbolic_Env.gd diff --git a/source/assets/scripts/shooting/Line/Line_Barrel.gd b/source/assets/scripts/shooting/Line/Line_Barrel.gd new file mode 100644 index 0000000..0d193a9 --- /dev/null +++ b/source/assets/scripts/shooting/Line/Line_Barrel.gd @@ -0,0 +1,16 @@ +extends StaticBody2D # Y = aX + +onready var bullet_env = preload("res://source/entities/shooting/Line_Trajectory/Line_Env.tscn") + + +func shoot(): + var bullet = bullet_env.instance() + get_parent().get_parent().get_parent().add_child(bullet) + bullet.global_position = $Position2D.global_position + bullet.global_rotation = $Position2D.global_rotation + + + +func _process(delta): + if Input.is_action_just_pressed("input_shoot"): + shoot() diff --git a/source/entities/shooting/script/Line/Line_Bullet.gd b/source/assets/scripts/shooting/Line/Line_Bullet.gd similarity index 93% rename from source/entities/shooting/script/Line/Line_Bullet.gd rename to source/assets/scripts/shooting/Line/Line_Bullet.gd index 7ca1846..319427f 100644 --- a/source/entities/shooting/script/Line/Line_Bullet.gd +++ b/source/assets/scripts/shooting/Line/Line_Bullet.gd @@ -1,4 +1,4 @@ -extends Area2D +extends Sprite export var speed = 100 var velocity = Vector2() @@ -34,7 +34,7 @@ func _process(delta): position += velocity * speed * delta -func _on_Bullet_body_entered(body): +func _on_hitbox_body_entered(body): if body.is_in_group("mobs"): body.queue_free() queue_free() diff --git a/source/entities/shooting/script/Line/Line_Env.gd b/source/assets/scripts/shooting/Line/Line_Env.gd similarity index 100% rename from source/entities/shooting/script/Line/Line_Env.gd rename to source/assets/scripts/shooting/Line/Line_Env.gd diff --git a/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd b/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd new file mode 100644 index 0000000..1df7718 --- /dev/null +++ b/source/assets/scripts/shooting/Parabola/Parabolic_Barrel.gd @@ -0,0 +1,16 @@ +extends StaticBody2D # Y = aX + +onready var bullet_env = preload("res://source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn") + + +func shoot(): + var bullet = bullet_env.instance() + get_parent().get_parent().get_parent().add_child(bullet) + bullet.global_position = $Position2D.global_position + bullet.global_rotation = $Position2D.global_rotation + + + +func _process(delta): + if Input.is_action_just_pressed("input_shoot"): + shoot() diff --git a/source/entities/shooting/script/Parabola/Parabolic_Bullet.gd b/source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd similarity index 90% rename from source/entities/shooting/script/Parabola/Parabolic_Bullet.gd rename to source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd index beee2de..3e4b6ae 100644 --- a/source/entities/shooting/script/Parabola/Parabolic_Bullet.gd +++ b/source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd @@ -18,7 +18,7 @@ func _process(delta): position += velocity * speed * delta -func _on_Bullet_body_entered(body): +func _on_hitbox_body_entered(body): if body.is_in_group("mobs"): body.queue_free() queue_free() diff --git a/source/entities/shooting/script/Parabola/Parabolic_Env.gd b/source/assets/scripts/shooting/Parabola/Parabolic_Env.gd similarity index 100% rename from source/entities/shooting/script/Parabola/Parabolic_Env.gd rename to source/assets/scripts/shooting/Parabola/Parabolic_Env.gd diff --git a/source/entities/shooting/Sine_Trajectory/Sine_Barrel.gd b/source/assets/scripts/shooting/Sine/Sine_Barrel.gd similarity index 100% rename from source/entities/shooting/Sine_Trajectory/Sine_Barrel.gd rename to source/assets/scripts/shooting/Sine/Sine_Barrel.gd diff --git a/source/entities/shooting/script/Sine/Sine_Bullet.gd b/source/assets/scripts/shooting/Sine/Sine_Bullet.gd similarity index 91% rename from source/entities/shooting/script/Sine/Sine_Bullet.gd rename to source/assets/scripts/shooting/Sine/Sine_Bullet.gd index dfd000a..98722ea 100644 --- a/source/entities/shooting/script/Sine/Sine_Bullet.gd +++ b/source/assets/scripts/shooting/Sine/Sine_Bullet.gd @@ -18,7 +18,7 @@ func _process(delta): position += velocity * speed * delta -func _on_Bullet_body_entered(body): +func _on_hitbox_body_entered(body): if body.is_in_group("mobs"): body.queue_free() queue_free() diff --git a/source/entities/shooting/script/Sine/Sine_Env.gd b/source/assets/scripts/shooting/Sine/Sine_Env.gd similarity index 100% rename from source/entities/shooting/script/Sine/Sine_Env.gd rename to source/assets/scripts/shooting/Sine/Sine_Env.gd diff --git a/source/entities/player/player_node.tscn b/source/entities/player/player_node.tscn index 824b885..5f5494c 100644 --- a/source/entities/player/player_node.tscn +++ b/source/entities/player/player_node.tscn @@ -15,7 +15,7 @@ [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle – 7.png" type="Texture" id=13] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle – 12.png" type="Texture" id=14] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle – 10.png" type="Texture" id=15] -[ext_resource path="res://source/entities/player/Gun_.gd" type="Script" id=16] +[ext_resource path="res://source/assets/scripts/shooting/Gun_.gd" type="Script" id=16] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle – 18.png" type="Texture" id=18] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/right_r/Player-character-theme-01_anim-idle – 34.png" type="Texture" id=19] [ext_resource path="res://source/assets/sprites/character/player/theme/01/animation/left_r/Player-character-theme-01_anim-idle – 17.png" type="Texture" id=20] diff --git a/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn b/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn index ceca1f7..9a0d2f8 100644 --- a/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn +++ b/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Bullet.tscn @@ -1,22 +1,22 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://source/entities/shooting/script/pixil-frame-0 (1).png" type="Texture" id=1] -[ext_resource path="res://source/entities/shooting/script/Hyperbola/Hyperbolic_Bullet.gd" type="Script" id=2] +[ext_resource path="res://source/assets/sprites/bullet/bullet.png" type="Texture" id=1] +[ext_resource path="res://source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd" type="Script" id=2] [sub_resource type="CapsuleShape2D" id=1] -radius = 5.4212 -height = 7.62897 -[node name="Bullet" type="Area2D"] +[node name="playert_bullet" type="Sprite" groups=[ +"Net", +]] +texture = ExtResource( 1 ) script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] -position = Vector2( 2, -19 ) -scale = Vector2( 0.199834, 0.199834 ) -texture = ExtResource( 1 ) +[node name="hitbox" type="Area2D" parent="." groups=[ +"Player_damager", +]] -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] rotation = 1.5708 shape = SubResource( 1 ) -[connection signal="body_entered" from="." to="." method="_on_Bullet_body_entered"] +[connection signal="body_entered" from="hitbox" to="." method="_on_hitbox_body_entered"] diff --git a/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Env.tscn b/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Env.tscn index 5ec5b09..da147ed 100644 --- a/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Env.tscn +++ b/source/entities/shooting/Hyperbolic_Trajectory/Hyperbolic_Env.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://source/entities/shooting/Line_Trajectory/Line_Bullet.tscn" type="PackedScene" id=1] -[ext_resource path="res://source/entities/shooting/script/Hyperbola/Hyperbolic_Env.gd" type="Script" id=2] -[ext_resource path="res://source/entities/shooting/script/Hyperbola/Hyperbolic_Bullet.gd" type="Script" id=3] +[ext_resource path="res://source/assets/scripts/shooting/Hyperbola/Hyperbolic_Env.gd" type="Script" id=2] +[ext_resource path="res://source/assets/scripts/shooting/Hyperbola/Hyperbolic_Bullet.gd" type="Script" id=3] [node name="Env" type="Node2D"] script = ExtResource( 2 ) diff --git a/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn b/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn index 663d286..4cdb733 100644 --- a/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn +++ b/source/entities/shooting/Line_Trajectory/Line_Bullet.tscn @@ -1,22 +1,22 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://source/entities/shooting/script/pixil-frame-0 (1).png" type="Texture" id=1] -[ext_resource path="res://source/entities/shooting/script/Line/Line_Bullet.gd" type="Script" id=2] +[ext_resource path="res://source/assets/sprites/bullet/bullet.png" type="Texture" id=1] +[ext_resource path="res://source/assets/scripts/shooting/Line/Line_Bullet.gd" type="Script" id=2] [sub_resource type="CapsuleShape2D" id=1] -radius = 5.4212 -height = 7.62897 -[node name="Bullet" type="Area2D"] +[node name="player_bullet" type="Sprite" groups=[ +"Net", +]] +texture = ExtResource( 1 ) script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] -position = Vector2( 2, -19 ) -scale = Vector2( 0.199834, 0.199834 ) -texture = ExtResource( 1 ) +[node name="hitbox" type="Area2D" parent="." groups=[ +"Player_damager", +]] -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] rotation = 1.5708 shape = SubResource( 1 ) -[connection signal="body_entered" from="." to="." method="_on_Bullet_body_entered"] +[connection signal="body_entered" from="hitbox" to="." method="_on_hitbox_body_entered"] diff --git a/source/entities/shooting/Line_Trajectory/Line_Env.tscn b/source/entities/shooting/Line_Trajectory/Line_Env.tscn index fd6cdd7..d355a02 100644 --- a/source/entities/shooting/Line_Trajectory/Line_Env.tscn +++ b/source/entities/shooting/Line_Trajectory/Line_Env.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://source/entities/shooting/Line_Trajectory/Line_Bullet.tscn" type="PackedScene" id=1] -[ext_resource path="res://source/entities/shooting/script/Line/Line_Env.gd" type="Script" id=2] +[ext_resource path="res://source/assets/scripts/shooting/Line/Line_Env.gd" type="Script" id=2] [node name="Env" type="Node2D"] script = ExtResource( 2 ) diff --git a/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn b/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn index 663d286..391d84f 100644 --- a/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn +++ b/source/entities/shooting/Parabolic_Trajectory/Parabolic_Bullet.tscn @@ -1,22 +1,22 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://source/entities/shooting/script/pixil-frame-0 (1).png" type="Texture" id=1] -[ext_resource path="res://source/entities/shooting/script/Line/Line_Bullet.gd" type="Script" id=2] +[ext_resource path="res://source/assets/sprites/bullet/bullet.png" type="Texture" id=1] +[ext_resource path="res://source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd" type="Script" id=2] [sub_resource type="CapsuleShape2D" id=1] -radius = 5.4212 -height = 7.62897 -[node name="Bullet" type="Area2D"] +[node name="player_bullet" type="Sprite" groups=[ +"Net", +]] +texture = ExtResource( 1 ) script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] -position = Vector2( 2, -19 ) -scale = Vector2( 0.199834, 0.199834 ) -texture = ExtResource( 1 ) +[node name="hitbox" type="Area2D" parent="." groups=[ +"Player_damager", +]] -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] rotation = 1.5708 shape = SubResource( 1 ) -[connection signal="body_entered" from="." to="." method="_on_Bullet_body_entered"] +[connection signal="body_entered" from="hitbox" to="." method="_on_hitbox_body_entered"] diff --git a/source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn b/source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn index 6be9026..86beaa0 100644 --- a/source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn +++ b/source/entities/shooting/Parabolic_Trajectory/Parabolic_Env.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://source/entities/shooting/Line_Trajectory/Line_Bullet.tscn" type="PackedScene" id=1] -[ext_resource path="res://source/entities/shooting/script/Parabola/Parabolic_Env.gd" type="Script" id=2] -[ext_resource path="res://source/entities/shooting/script/Parabola/Parabolic_Bullet.gd" type="Script" id=3] +[ext_resource path="res://source/assets/scripts/shooting/Parabola/Parabolic_Env.gd" type="Script" id=2] +[ext_resource path="res://source/assets/scripts/shooting/Parabola/Parabolic_Bullet.gd" type="Script" id=3] [node name="Env" type="Node2D"] script = ExtResource( 2 ) diff --git a/source/entities/shooting/Sine_Trajectory/Sine_Barrel.tscn b/source/entities/shooting/Sine_Trajectory/Sine_Barrel.tscn index ff87d5d..5c2db70 100644 --- a/source/entities/shooting/Sine_Trajectory/Sine_Barrel.tscn +++ b/source/entities/shooting/Sine_Trajectory/Sine_Barrel.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://source/entities/shooting/Sine_Trajectory/Sine_Barrel.gd" type="Script" id=1] +[ext_resource path="res://source/assets/scripts/shooting/Sine/Sine_Barrel.gd" type="Script" id=1] [node name="Sine_Barrel" type="Line2D"] show_behind_parent = true diff --git a/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn b/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn index 342b744..536bf28 100644 --- a/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn +++ b/source/entities/shooting/Sine_Trajectory/Sine_Bullet.tscn @@ -1,22 +1,22 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://source/entities/shooting/script/pixil-frame-0 (1).png" type="Texture" id=1] -[ext_resource path="res://source/entities/shooting/script/Sine/Sine_Bullet.gd" type="Script" id=2] +[ext_resource path="res://source/assets/sprites/bullet/bullet.png" type="Texture" id=1] +[ext_resource path="res://source/assets/scripts/shooting/Sine/Sine_Bullet.gd" type="Script" id=2] [sub_resource type="CapsuleShape2D" id=1] -radius = 5.4212 -height = 7.62897 -[node name="Bullet" type="Area2D"] +[node name="player_bullet" type="Sprite" groups=[ +"Net", +]] +texture = ExtResource( 1 ) script = ExtResource( 2 ) -[node name="Sprite" type="Sprite" parent="."] -position = Vector2( 2, -19 ) -scale = Vector2( 0.199834, 0.199834 ) -texture = ExtResource( 1 ) +[node name="hitbox" type="Area2D" parent="." groups=[ +"Player_damager", +]] -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +[node name="CollisionShape2D" type="CollisionShape2D" parent="hitbox"] rotation = 1.5708 shape = SubResource( 1 ) -[connection signal="body_entered" from="." to="." method="_on_Bullet_body_entered"] +[connection signal="body_entered" from="hitbox" to="." method="_on_hitbox_body_entered"] diff --git a/source/entities/shooting/Sine_Trajectory/Sine_Env.tscn b/source/entities/shooting/Sine_Trajectory/Sine_Env.tscn index 96b2aa5..43043ba 100644 --- a/source/entities/shooting/Sine_Trajectory/Sine_Env.tscn +++ b/source/entities/shooting/Sine_Trajectory/Sine_Env.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://source/entities/shooting/Line_Trajectory/Line_Bullet.tscn" type="PackedScene" id=1] -[ext_resource path="res://source/entities/shooting/script/Sine/Sine_Env.gd" type="Script" id=2] -[ext_resource path="res://source/entities/shooting/script/Sine/Sine_Bullet.gd" type="Script" id=3] +[ext_resource path="res://source/assets/scripts/shooting/Sine/Sine_Env.gd" type="Script" id=2] +[ext_resource path="res://source/assets/scripts/shooting/Sine/Sine_Bullet.gd" type="Script" id=3] [node name="Env" type="Node2D"] script = ExtResource( 2 ) diff --git a/source/entities/shooting/script/Hyperbola/Hyperbolic_Barrel.gd b/source/entities/shooting/script/Hyperbola/Hyperbolic_Barrel.gd deleted file mode 100644 index fc808d6..0000000 --- a/source/entities/shooting/script/Hyperbola/Hyperbolic_Barrel.gd +++ /dev/null @@ -1,16 +0,0 @@ -extends StaticBody2D # Y = aX - -onready var bullet = preload("res://Hyperbolic_Trajectory/Hyperbolic_Env.tscn") - - -func shoot(): - var b = bullet.instance() - get_parent().get_parent().get_parent().add_child(b) - b.global_position = $Position2D.global_position - b.global_rotation = $Position2D.global_rotation - - - -func _process(delta): - if Input.is_action_just_pressed("shoot"): - shoot() diff --git a/source/entities/shooting/script/Line/Line_Barrel.gd b/source/entities/shooting/script/Line/Line_Barrel.gd deleted file mode 100644 index 4ba9307..0000000 --- a/source/entities/shooting/script/Line/Line_Barrel.gd +++ /dev/null @@ -1,16 +0,0 @@ -extends StaticBody2D # Y = aX - -onready var bullet = preload("res://Line_Trajectory/Line_Env.tscn") - - -func shoot(): - var b = bullet.instance() - get_parent().get_parent().get_parent().add_child(b) - b.global_position = $Position2D.global_position - b.global_rotation = $Position2D.global_rotation - - - -func _process(delta): - if Input.is_action_just_pressed("shoot"): - shoot() diff --git a/source/entities/shooting/script/Parabola/Parabolic_Barrel.gd b/source/entities/shooting/script/Parabola/Parabolic_Barrel.gd deleted file mode 100644 index d020184..0000000 --- a/source/entities/shooting/script/Parabola/Parabolic_Barrel.gd +++ /dev/null @@ -1,16 +0,0 @@ -extends StaticBody2D # Y = aX - -onready var bullet = preload("res://Parabolic_Trajectory/Parabolic_Env.tscn") - - -func shoot(): - var b = bullet.instance() - get_parent().get_parent().get_parent().add_child(b) - b.global_position = $Position2D.global_position - b.global_rotation = $Position2D.global_rotation - - - -func _process(delta): - if Input.is_action_just_pressed("shoot"): - shoot() diff --git a/source/entities/shooting/script/Sine/Sine_Barrel.gd b/source/entities/shooting/script/Sine/Sine_Barrel.gd deleted file mode 100644 index 79ce4e8..0000000 --- a/source/entities/shooting/script/Sine/Sine_Barrel.gd +++ /dev/null @@ -1,20 +0,0 @@ -extends StaticBody2D - -onready var bullet = preload("res://Sine_Trajectory/Sine_Env.tscn") - -var velocity = Vector2(1, 0) -var shooting_speed = 200 - - - -func shoot(): - var b = bullet.instance() - get_parent().get_parent().get_parent().add_child(b) - b.global_position = $Position2D.global_position - b.global_rotation = $Position2D.global_rotation - pass - - -func _process(delta): - if Input.is_action_just_pressed("shoot"): - shoot()