forked from team-sg/hero-mark-2
buncha bullshit
This commit is contained in:
parent
0fa8ab9930
commit
0cfe581493
8 changed files with 175 additions and 0 deletions
20
objects/enemy/death_particles_big.gd
Normal file
20
objects/enemy/death_particles_big.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends CPUParticles2D
|
||||
|
||||
|
||||
const BloodSpray := preload("res://objects/environment/blood/blood_spray_big.tscn")
|
||||
|
||||
|
||||
export var spray_ammount: int = 1
|
||||
export var spray_velocity: float = 120
|
||||
export var autoplay: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if autoplay:
|
||||
emitting = true
|
||||
yield(get_tree(), "idle_frame")
|
||||
for i in spray_ammount:
|
||||
var spray = BloodSpray.instance()
|
||||
spray.global_position = global_position
|
||||
spray.velocity = Vector2(randf() * spray_velocity, 0.0).rotated(randf() * (TAU / 45))
|
||||
get_parent().add_child(spray)
|
30
objects/enemy/death_particles_big.tscn
Normal file
30
objects/enemy/death_particles_big.tscn
Normal file
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/enemy/death_particles_big.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="Curve" id=43]
|
||||
_data = [ Vector2( 0, 1 ), 0.0, -0.113537, 0, 0, Vector2( 1, 0 ), -3.35032, 0.0, 0, 0 ]
|
||||
|
||||
[node name="DeathSplatter" type="CPUParticles2D"]
|
||||
emitting = false
|
||||
amount = 32
|
||||
lifetime = 0.3
|
||||
one_shot = true
|
||||
explosiveness = 0.9
|
||||
local_coords = false
|
||||
texture = ExtResource( 1 )
|
||||
emission_shape = 2
|
||||
emission_rect_extents = Vector2( 4, 4 )
|
||||
direction = Vector2( 0, -1 )
|
||||
spread = 180.0
|
||||
gravity = Vector2( 0, 50 )
|
||||
initial_velocity = 60.0
|
||||
initial_velocity_random = 0.9
|
||||
damping = 2.0
|
||||
angle = 720.0
|
||||
angle_random = 1.0
|
||||
scale_amount = 0.5
|
||||
scale_amount_random = 1.0
|
||||
scale_amount_curve = SubResource( 43 )
|
||||
script = ExtResource( 2 )
|
42
objects/environment/blood/blood_spray_big.gd
Normal file
42
objects/environment/blood/blood_spray_big.gd
Normal file
|
@ -0,0 +1,42 @@
|
|||
extends Area2D
|
||||
|
||||
|
||||
const BloodStain := preload("res://objects/environment/blood/blood_stain.tscn")
|
||||
const PlayerStain := preload("res://objects/player/player_stain.tscn")
|
||||
|
||||
|
||||
export var color: Color
|
||||
export var stains_player: bool = true
|
||||
|
||||
|
||||
var velocity := Vector2.ZERO
|
||||
|
||||
|
||||
onready var sprite: Sprite = $Sprite
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
sprite.self_modulate = color
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
velocity.y += 98.0 * delta
|
||||
position += velocity * delta
|
||||
sprite.global_rotation = velocity.angle()
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
if body.is_in_group("can_stain"):
|
||||
var stain = BloodStain.instance()
|
||||
stain.modulate = color
|
||||
stain.global_position = global_position
|
||||
StainLayer.add_stain(stain)
|
||||
queue_free()
|
||||
elif body is TileMap:
|
||||
queue_free()
|
||||
elif stains_player and body.is_in_group("player"):
|
||||
var stain = PlayerStain.instance()
|
||||
stain.color = color
|
||||
body.get_node("Graphics/Sprite").add_child(stain)
|
||||
stain.global_position = global_position
|
||||
queue_free()
|
23
objects/environment/blood/blood_spray_big.tscn
Normal file
23
objects/environment/blood/blood_spray_big.tscn
Normal file
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/particles/famira_blood.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/environment/blood/blood_spray_big.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 0.5
|
||||
|
||||
[node name="BloodSpray" type="Area2D"]
|
||||
collision_mask = 129
|
||||
script = ExtResource( 2 )
|
||||
color = Color( 0.701961, 0.745098, 0.4, 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.75, 0.5 )
|
||||
texture = ExtResource( 1 )
|
||||
offset = Vector2( 2, 0 )
|
||||
flip_h = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
20
objects/environment/test_fire/test_fire.tscn
Normal file
20
objects/environment/test_fire/test_fire.tscn
Normal file
|
@ -0,0 +1,20 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/backgrounds/fire.png" type="Texture" id=1]
|
||||
[ext_resource path="res://shaders/fire.gdshader" type="Shader" id=2]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 2 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
margin_right = 256.0
|
||||
margin_bottom = 192.0
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
|
||||
[node name="Fire" type="Sprite" parent="."]
|
||||
material = SubResource( 1 )
|
||||
position = Vector2( 144, 96 )
|
||||
scale = Vector2( 2.02667, 1 )
|
||||
texture = ExtResource( 1 )
|
Loading…
Add table
Add a link
Reference in a new issue