diff --git a/objects/enemy/scope.tscn b/objects/enemy/scope.tscn new file mode 100644 index 0000000..7f9ef94 --- /dev/null +++ b/objects/enemy/scope.tscn @@ -0,0 +1,148 @@ +[gd_scene load_steps=19 format=2] + +[ext_resource path="res://objects/enemy/cop.gd" type="Script" id=1] +[ext_resource path="res://graphics/enemy/cop/scope_idle.png" type="Texture" id=2] +[ext_resource path="res://graphics/enemy/cop/scope_walk.png" type="Texture" id=3] +[ext_resource path="res://graphics/enemy/cop/scope_shoot.png" type="Texture" id=4] +[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=5] +[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=6] +[ext_resource path="res://graphics/particles/muzzle_flash.png" type="Texture" id=7] + +[sub_resource type="ShaderMaterial" id=7] +shader = ExtResource( 5 ) +shader_param/border_color = Color( 0, 0, 0, 1 ) +shader_param/border_corners = true + +[sub_resource type="AtlasTexture" id=13] +atlas = ExtResource( 3 ) +region = Rect2( 0, 0, 20, 21 ) + +[sub_resource type="AtlasTexture" id=14] +atlas = ExtResource( 3 ) +region = Rect2( 20, 0, 20, 21 ) + +[sub_resource type="AtlasTexture" id=15] +atlas = ExtResource( 3 ) +region = Rect2( 40, 0, 20, 21 ) + +[sub_resource type="AtlasTexture" id=16] +atlas = ExtResource( 3 ) +region = Rect2( 60, 0, 20, 21 ) + +[sub_resource type="SpriteFrames" id=6] +animations = [ { +"frames": [ ExtResource( 2 ) ], +"loop": false, +"name": "idle", +"speed": 5.0 +}, { +"frames": [ ExtResource( 4 ) ], +"loop": false, +"name": "shoot", +"speed": 1.0 +}, { +"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ) ], +"loop": true, +"name": "walk", +"speed": 5.0 +} ] + +[sub_resource type="Curve" id=11] +_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.5, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="Gradient" id=12] +interpolation_mode = 2 +offsets = PoolRealArray( 0.20339, 0.432203 ) +colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 0.290196, 1 ) + +[sub_resource type="RectangleShape2D" id=8] +extents = Vector2( 3, 8 ) + +[sub_resource type="Curve" id=9] +_data = [ Vector2( 0, 1 ), 0.0, -1.45746, 0, 0, Vector2( 1, 0 ), 0.00323196, 0.0, 0, 0 ] + +[sub_resource type="Gradient" id=10] +offsets = PoolRealArray( 0, 0.515152 ) +colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 0.290196, 1 ) + +[node name="Cop" type="Node2D" groups=["cop", "enemy"]] +script = ExtResource( 1 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +show_behind_parent = true +material = SubResource( 7 ) +position = Vector2( 5, -2 ) +frames = SubResource( 6 ) +animation = "idle" +playing = true + +[node name="ShootPosition" type="Position2D" parent="AnimatedSprite"] +unique_name_in_owner = true +position = Vector2( 7, 0.5 ) +__meta__ = { +"_gizmo_extents_": 4.0 +} + +[node name="ShootCast" type="RayCast2D" parent="AnimatedSprite/ShootPosition"] +unique_name_in_owner = true +enabled = true +cast_to = Vector2( 72, 0 ) +collision_mask = 8 +collide_with_areas = true + +[node name="GraphicsCast" type="RayCast2D" parent="AnimatedSprite/ShootPosition"] +unique_name_in_owner = true +visible = false +cast_to = Vector2( 256, 0 ) +collision_mask = 8 + +[node name="ShootLine" type="Line2D" parent="AnimatedSprite/ShootPosition"] +unique_name_in_owner = true +visible = false +points = PoolVector2Array( 0, 0, 8, 0 ) +width = 1.0 +default_color = Color( 1, 1, 0.290196, 1 ) + +[node name="MuzzleFlashParticles" type="CPUParticles2D" parent="AnimatedSprite/ShootPosition"] +pause_mode = 2 +unique_name_in_owner = true +rotation = 1.0472 +emitting = false +amount = 6 +lifetime = 0.1 +one_shot = true +explosiveness = 0.75 +draw_order = 1 +texture = ExtResource( 7 ) +gravity = Vector2( 0, 0 ) +angle = 120.0 +angle_random = 1.0 +scale_amount_curve = SubResource( 11 ) +color_ramp = SubResource( 12 ) + +[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +position = Vector2( 4, 0 ) +shape = SubResource( 8 ) + +[node name="SparkParticles" type="CPUParticles2D" parent="."] +position = Vector2( 4, 0 ) +emitting = false +amount = 16 +lifetime = 0.5 +one_shot = true +explosiveness = 1.0 +texture = ExtResource( 6 ) +spread = 180.0 +gravity = Vector2( 0, 0 ) +initial_velocity = 30.0 +initial_velocity_random = 0.5 +damping = 50.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.5 +scale_amount_curve = SubResource( 9 ) +color_ramp = SubResource( 10 ) + +[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"] diff --git a/objects/enemy/sheriff.tscn b/objects/enemy/sheriff.tscn new file mode 100644 index 0000000..8e6bd67 --- /dev/null +++ b/objects/enemy/sheriff.tscn @@ -0,0 +1,148 @@ +[gd_scene load_steps=19 format=2] + +[ext_resource path="res://objects/enemy/cop.gd" type="Script" id=1] +[ext_resource path="res://graphics/enemy/cop/the_sheriff_idle.png" type="Texture" id=2] +[ext_resource path="res://graphics/enemy/cop/the_sheriff_shoot.png" type="Texture" id=3] +[ext_resource path="res://graphics/enemy/cop/the_sheriff_walk.png" type="Texture" id=4] +[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=5] +[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=6] +[ext_resource path="res://graphics/particles/muzzle_flash.png" type="Texture" id=7] + +[sub_resource type="ShaderMaterial" id=7] +shader = ExtResource( 5 ) +shader_param/border_color = Color( 0, 0, 0, 1 ) +shader_param/border_corners = true + +[sub_resource type="AtlasTexture" id=13] +atlas = ExtResource( 4 ) +region = Rect2( 0, 0, 20, 21 ) + +[sub_resource type="AtlasTexture" id=14] +atlas = ExtResource( 4 ) +region = Rect2( 20, 0, 20, 21 ) + +[sub_resource type="AtlasTexture" id=15] +atlas = ExtResource( 4 ) +region = Rect2( 40, 0, 20, 21 ) + +[sub_resource type="AtlasTexture" id=16] +atlas = ExtResource( 4 ) +region = Rect2( 60, 0, 20, 21 ) + +[sub_resource type="SpriteFrames" id=6] +animations = [ { +"frames": [ ExtResource( 2 ) ], +"loop": false, +"name": "idle", +"speed": 5.0 +}, { +"frames": [ ExtResource( 3 ) ], +"loop": false, +"name": "shoot", +"speed": 1.0 +}, { +"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ) ], +"loop": true, +"name": "walk", +"speed": 5.0 +} ] + +[sub_resource type="Curve" id=11] +_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.5, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="Gradient" id=12] +interpolation_mode = 2 +offsets = PoolRealArray( 0.20339, 0.432203 ) +colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 0.290196, 1 ) + +[sub_resource type="RectangleShape2D" id=8] +extents = Vector2( 3, 8 ) + +[sub_resource type="Curve" id=9] +_data = [ Vector2( 0, 1 ), 0.0, -1.45746, 0, 0, Vector2( 1, 0 ), 0.00323196, 0.0, 0, 0 ] + +[sub_resource type="Gradient" id=10] +offsets = PoolRealArray( 0, 0.515152 ) +colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 0.290196, 1 ) + +[node name="Cop" type="Node2D" groups=["cop", "enemy"]] +script = ExtResource( 1 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +show_behind_parent = true +material = SubResource( 7 ) +position = Vector2( 5, -2 ) +frames = SubResource( 6 ) +animation = "idle" +playing = true + +[node name="ShootPosition" type="Position2D" parent="AnimatedSprite"] +unique_name_in_owner = true +position = Vector2( 7, 0.5 ) +__meta__ = { +"_gizmo_extents_": 4.0 +} + +[node name="ShootCast" type="RayCast2D" parent="AnimatedSprite/ShootPosition"] +unique_name_in_owner = true +enabled = true +cast_to = Vector2( 72, 0 ) +collision_mask = 8 +collide_with_areas = true + +[node name="GraphicsCast" type="RayCast2D" parent="AnimatedSprite/ShootPosition"] +unique_name_in_owner = true +visible = false +cast_to = Vector2( 256, 0 ) +collision_mask = 8 + +[node name="ShootLine" type="Line2D" parent="AnimatedSprite/ShootPosition"] +unique_name_in_owner = true +visible = false +points = PoolVector2Array( 0, 0, 8, 0 ) +width = 1.0 +default_color = Color( 1, 1, 0.290196, 1 ) + +[node name="MuzzleFlashParticles" type="CPUParticles2D" parent="AnimatedSprite/ShootPosition"] +pause_mode = 2 +unique_name_in_owner = true +rotation = 1.0472 +emitting = false +amount = 6 +lifetime = 0.1 +one_shot = true +explosiveness = 0.75 +draw_order = 1 +texture = ExtResource( 7 ) +gravity = Vector2( 0, 0 ) +angle = 120.0 +angle_random = 1.0 +scale_amount_curve = SubResource( 11 ) +color_ramp = SubResource( 12 ) + +[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +position = Vector2( 4, 0 ) +shape = SubResource( 8 ) + +[node name="SparkParticles" type="CPUParticles2D" parent="."] +position = Vector2( 4, 0 ) +emitting = false +amount = 16 +lifetime = 0.5 +one_shot = true +explosiveness = 1.0 +texture = ExtResource( 6 ) +spread = 180.0 +gravity = Vector2( 0, 0 ) +initial_velocity = 30.0 +initial_velocity_random = 0.5 +damping = 50.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.5 +scale_amount_curve = SubResource( 9 ) +color_ramp = SubResource( 10 ) + +[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]