It's blood.
This commit is contained in:
parent
8c818ac174
commit
8264c9c1b8
18 changed files with 107 additions and 58 deletions
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.1 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=27 format=2]
|
||||
[gd_scene load_steps=28 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/super_slime.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://tilesets/t_cave.tres" type="TileSet" id=2]
|
||||
|
@ -8,6 +8,7 @@
|
|||
[ext_resource path="res://objects/environment/moving_platform/moving_platform.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://graphics/backgrounds/canopy.png" type="Texture" id=7]
|
||||
[ext_resource path="res://objects/environment/collapse_block/collapse_block.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://shaders/can_stain.tres" type="Material" id=9]
|
||||
[ext_resource path="res://objects/enemy/slime.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://maps/map.gd" type="Script" id=11]
|
||||
[ext_resource path="res://objects/environment/turniwood/turning_platform.tscn" type="PackedScene" id=12]
|
||||
|
@ -58,7 +59,9 @@ __meta__ = {
|
|||
|
||||
[node name="CanvasLayer" parent="." instance=ExtResource( 4 )]
|
||||
|
||||
[node name="Ground" type="TileMap" parent="."]
|
||||
[node name="Ground" type="TileMap" parent="." groups=["can_stain"]]
|
||||
light_mask = 3
|
||||
material = ExtResource( 9 )
|
||||
tile_set = ExtResource( 3 )
|
||||
cell_size = Vector2( 8, 8 )
|
||||
collision_layer = 9
|
||||
|
@ -128,7 +131,6 @@ material = SubResource( 4 )
|
|||
position = Vector2( 4, 4 )
|
||||
z_index = -3
|
||||
frames = SubResource( 5 )
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="Steam" parent="." instance=ExtResource( 23 )]
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/environment/blood/blood_splatter.gd" type="Script" id=2]
|
||||
|
||||
[node name="Splatter" type="Light2D"]
|
||||
texture = ExtResource( 1 )
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
energy = 4.0
|
||||
mode = 2
|
||||
range_item_cull_mask = 3
|
||||
script = ExtResource( 2 )
|
|
@ -1,19 +1,29 @@
|
|||
extends RigidBody2D
|
||||
|
||||
|
||||
const BloodSplatter := preload("res://objects/environment/blood/blood_splatter.tscn")
|
||||
const BloodStain := preload("res://objects/environment/blood/blood_stain.tscn")
|
||||
|
||||
|
||||
export var color: Color = Color(0xf53342ff)
|
||||
|
||||
|
||||
onready var sprite: Sprite = $Sprite
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
sprite.self_modulate = color
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
sprite.global_rotation = linear_velocity.angle()
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
if body is TileMap:
|
||||
var splatter = BloodSplatter.instance()
|
||||
splatter.global_position = global_position
|
||||
get_parent().add_child(splatter)
|
||||
if body.is_in_group("can_stain"):
|
||||
var stain = BloodStain.instance()
|
||||
stain.color = color
|
||||
stain.global_position = global_position
|
||||
body.add_child(stain)
|
||||
queue_free()
|
||||
elif body is TileMap:
|
||||
queue_free()
|
||||
|
|
|
@ -12,8 +12,8 @@ contact_monitor = true
|
|||
script = ExtResource( 3 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
modulate = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
self_modulate = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
scale = Vector2( 0.75, 0.5 )
|
||||
texture = ExtResource( 1 )
|
||||
offset = Vector2( 2, 0 )
|
||||
flip_h = true
|
||||
|
|
12
objects/environment/blood/blood_stain.tscn
Normal file
12
objects/environment/blood/blood_stain.tscn
Normal file
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/environment/blood/blood_stain.gd" type="Script" id=2]
|
||||
|
||||
[node name="BloodStain" type="Light2D"]
|
||||
light_mask = 3
|
||||
texture = ExtResource( 1 )
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
mode = 2
|
||||
range_item_cull_mask = 2
|
||||
script = ExtResource( 2 )
|
|
@ -276,7 +276,7 @@ func _on_Dead_state_entered() -> void:
|
|||
particles.global_position = death_splatter_position.global_position
|
||||
particles.emitting = true
|
||||
get_parent().add_child(particles)
|
||||
for i in 32:
|
||||
for i in 16:
|
||||
var spray: RigidBody2D = BloodSpray.instance()
|
||||
spray.global_position = global_position
|
||||
spray.linear_velocity = Vector2(80.0, 0.0).rotated(randf() * TAU)
|
||||
|
|
|
@ -1066,6 +1066,7 @@ angle_random = 1.0
|
|||
scale_amount = 0.25
|
||||
scale_amount_random = 0.5
|
||||
scale_amount_curve = SubResource( 13 )
|
||||
color = Color( 0.956863, 0.92549, 0.831373, 1 )
|
||||
|
||||
[node name="PushableDetector" type="RayCast2D" parent="Graphics"]
|
||||
unique_name_in_owner = true
|
||||
|
@ -1553,8 +1554,8 @@ align = 1
|
|||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Shooting" to="." method="_on_Shooting_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_on_Pushing_state_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
|
||||
|
|
15
shaders/can_stain.tres
Normal file
15
shaders/can_stain.tres
Normal file
|
@ -0,0 +1,15 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="Shader" id=2]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
COLOR = texture(TEXTURE, UV);
|
||||
// fucked up lighting change to make blood work perfectly
|
||||
if (AT_LIGHT_PASS) {
|
||||
COLOR = vec4(1.0, 1.0, 1.0, COLOR.a);
|
||||
}
|
||||
}"
|
||||
|
||||
[resource]
|
||||
shader = SubResource( 2 )
|
Loading…
Add table
Add a link
Reference in a new issue