give the pigs' guns a little more BANG for their buck HAHAHAHAHAHAHAHAHAHA

This commit is contained in:
Haze Weathers 2023-03-24 21:22:39 -04:00
parent 64ff2d38df
commit 659e812189
4 changed files with 67 additions and 1 deletions

View file

@ -15,6 +15,7 @@ onready var shoot_cast = $"%ShootCast"
onready var graphics_cast = $"%GraphicsCast"
onready var shoot_line = $"%ShootLine"
onready var sparks = $SparkParticles
onready var muzzle_flash = $"%MuzzleFlashParticles"
var shooting = false
var turns = 0
@ -40,6 +41,10 @@ func _physics_process(delta):
if collider != null && collider.is_in_group("player"):
# kill player and enter shooting state temporarily
collider.get_parent().die()
# play sound
Audio.play_sound(Audio.a_die_robot, Audio.ac_boss)
# muzzle flash
muzzle_flash.emitting = true
shooting = true
get_tree().create_timer(0.05, false).connect("timeout", self, "_stop_shoot")
sprite.play("shoot")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=2]
[gd_scene load_steps=20 format=2]
[ext_resource path="res://objects/enemy/cop.gd" type="Script" id=1]
[ext_resource path="res://graphics/enemy/cop/cop_idle.png" type="Texture" id=2]
@ -6,6 +6,7 @@
[ext_resource path="res://graphics/enemy/cop/cop_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 )
@ -50,6 +51,14 @@ animations = [ {
"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 )
@ -98,6 +107,23 @@ 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.2
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"]