This commit is contained in:
akshay 2022-08-19 00:57:53 -04:00
commit 3047245eae
2 changed files with 46 additions and 2 deletions

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=30 format=2] [gd_scene load_steps=35 format=2]
[ext_resource path="res://scripts/player/player.gd" type="Script" id=1] [ext_resource path="res://scripts/player/player.gd" type="Script" id=1]
[ext_resource path="res://assets/dungman/DungMan.tscn" type="PackedScene" id=2] [ext_resource path="res://assets/dungman/DungMan.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/icons/stomach.png" type="Texture" id=3] [ext_resource path="res://assets/icons/stomach.png" type="Texture" id=3]
[ext_resource path="res://assets/dungman/Dungee_MAT.material" type="Material" id=4] [ext_resource path="res://assets/dungman/Dungee_MAT.material" type="Material" id=4]
[ext_resource path="res://shaders/circlewipe.gdshader" type="Shader" id=5]
[sub_resource type="ArrayMesh" id=1] [sub_resource type="ArrayMesh" id=1]
resource_name = "DungMan_Mesh" resource_name = "DungMan_Mesh"
@ -683,6 +684,22 @@ colors = PoolColorArray( 0, 0, 0, 1, 0, 0, 0, 0.429105, 0, 0, 0, 0 )
gradient = SubResource( 20 ) gradient = SubResource( 20 )
fill_to = Vector2( 0, 1 ) fill_to = Vector2( 0, 1 )
[sub_resource type="ShaderMaterial" id=28]
shader = ExtResource( 5 )
shader_param/percent = 0.0
[sub_resource type="ShaderMaterial" id=29]
shader = ExtResource( 5 )
shader_param/percent = 0.0
[sub_resource type="ShaderMaterial" id=30]
shader = ExtResource( 5 )
shader_param/percent = 0.0
[sub_resource type="ShaderMaterial" id=31]
shader = ExtResource( 5 )
shader_param/percent = 0.31
[node name="Player" type="KinematicBody" groups=["player"]] [node name="Player" type="KinematicBody" groups=["player"]]
axis_lock_motion_y = true axis_lock_motion_y = true
move_lock_y = true move_lock_y = true
@ -697,7 +714,7 @@ mesh = SubResource( 1 )
skin = SubResource( 2 ) skin = SubResource( 2 )
[node name="head_bone" type="BoneAttachment" parent="model_transform/DungMan/Armature/Skeleton" index="1"] [node name="head_bone" type="BoneAttachment" parent="model_transform/DungMan/Armature/Skeleton" index="1"]
transform = Transform( 1, -2.22044e-16, -4.27702e-19, 2.64698e-23, -0.00192609, 0.999998, -2.22045e-16, -0.999998, -0.00192609, -3.33198e-16, 0.00261936, -1.49514 ) transform = Transform( 1, -2.21988e-16, 5.59982e-18, -6.93938e-20, 0.0249053, 0.99969, -2.22059e-16, -0.99969, 0.0249053, -3.32446e-16, -0.0244905, -1.49896 )
bone_name = "Item" bone_name = "Item"
[node name="ItemSpawn" type="Spatial" parent="model_transform/DungMan/Armature/Skeleton/head_bone"] [node name="ItemSpawn" type="Spatial" parent="model_transform/DungMan/Armature/Skeleton/head_bone"]
@ -778,26 +795,34 @@ margin_right = 540.0
margin_bottom = 144.0 margin_bottom = 144.0
[node name="stomach0" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"] [node name="stomach0" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
material = SubResource( 28 )
margin_right = 128.0 margin_right = 128.0
margin_bottom = 128.0 margin_bottom = 128.0
rect_pivot_offset = Vector2( 128, 821 )
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="stomach1" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"] [node name="stomach1" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
material = SubResource( 29 )
margin_left = 132.0 margin_left = 132.0
margin_right = 260.0 margin_right = 260.0
margin_bottom = 128.0 margin_bottom = 128.0
rect_pivot_offset = Vector2( 128, 821 )
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="stomach2" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"] [node name="stomach2" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
material = SubResource( 30 )
margin_left = 264.0 margin_left = 264.0
margin_right = 392.0 margin_right = 392.0
margin_bottom = 128.0 margin_bottom = 128.0
rect_pivot_offset = Vector2( 128, 821 )
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="stomach3" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"] [node name="stomach3" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
material = SubResource( 31 )
margin_left = 396.0 margin_left = 396.0
margin_right = 524.0 margin_right = 524.0
margin_bottom = 128.0 margin_bottom = 128.0
rect_pivot_offset = Vector2( 128, 821 )
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="blackout" type="ColorRect" parent="UI"] [node name="blackout" type="ColorRect" parent="UI"]

View File

@ -0,0 +1,19 @@
shader_type canvas_item;
uniform float percent;
float atan2(in float y, in float x) {
bool s = (abs(x) > abs(y));
if (s) {
return 3.14159/2.0 - atan(x,y);
} else {
return atan(y,x);
}
}
void fragment() {
float angle = atan2((UV.y - 0.5) , (UV.x - 0.5));
float alpha = step(percent * 3.14159 * 2.25, angle + 3.14159);
vec4 color = texture(TEXTURE, UV);
COLOR = vec4(color.rgb, color.a * alpha);
}