piggy gore UwU
This commit is contained in:
parent
e1b5c498f3
commit
e6ed63dd60
2 changed files with 27 additions and 2 deletions
|
@ -9,7 +9,7 @@ export var idle_turns = 0
|
||||||
export var turn_time = 0.5
|
export var turn_time = 0.5
|
||||||
export var shoot_time = 1.0
|
export var shoot_time = 1.0
|
||||||
|
|
||||||
export var bones_amount = 5
|
export var bones_amount = 8
|
||||||
export var bones_speed = 50.0
|
export var bones_speed = 50.0
|
||||||
|
|
||||||
onready var sprite = $AnimatedSprite
|
onready var sprite = $AnimatedSprite
|
||||||
|
@ -24,6 +24,7 @@ var shooting = false
|
||||||
var turns = 0
|
var turns = 0
|
||||||
|
|
||||||
const BoneParticle = preload("res://objects/enemy/bone_particle.tscn")
|
const BoneParticle = preload("res://objects/enemy/bone_particle.tscn")
|
||||||
|
const GoreParticle = preload("res://objects/enemy/gore_particle.tscn")
|
||||||
const EasyBullet = preload("res://objects/enemy/roboturret_proj.tscn")
|
const EasyBullet = preload("res://objects/enemy/roboturret_proj.tscn")
|
||||||
const BulletCasing = preload("res://objects/enemy/bullet_casing.tscn")
|
const BulletCasing = preload("res://objects/enemy/bullet_casing.tscn")
|
||||||
|
|
||||||
|
@ -169,7 +170,11 @@ func _set_right_boundary(value):
|
||||||
|
|
||||||
func die():
|
func die():
|
||||||
for n in bones_amount:
|
for n in bones_amount:
|
||||||
var bone = BoneParticle.instance()
|
var bone
|
||||||
|
if randi() % 3 == 0:
|
||||||
|
bone = BoneParticle.instance()
|
||||||
|
else:
|
||||||
|
bone = GoreParticle.instance()
|
||||||
bone.rotation = rand_range(0.0, 2.0*PI) # random rotation
|
bone.rotation = rand_range(0.0, 2.0*PI) # random rotation
|
||||||
bone.global_position = global_position
|
bone.global_position = global_position
|
||||||
bone.linear_velocity = Vector2(bones_speed * rand_range(0.5, 1.5), 0.0).rotated(rand_range(-PI, 0.0))
|
bone.linear_velocity = Vector2(bones_speed * rand_range(0.5, 1.5), 0.0).rotated(rand_range(-PI, 0.0))
|
||||||
|
|
20
objects/enemy/gore_particle.tscn
Normal file
20
objects/enemy/gore_particle.tscn
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="PhysicsMaterial" id=4]
|
||||||
|
bounce = 0.25
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=3]
|
||||||
|
extents = Vector2( 1, 1 )
|
||||||
|
|
||||||
|
[node name="GoreParticle" type="RigidBody2D"]
|
||||||
|
collision_layer = 16
|
||||||
|
physics_material_override = SubResource( 4 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
scale = Vector2( 0.5, 0.5 )
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource( 3 )
|
Loading…
Add table
Add a link
Reference in a new issue