added Graphics and sound Effects and more overhauls
This commit is contained in:
parent
c887a2168c
commit
b9d4288900
214 changed files with 3378 additions and 198 deletions
6
scenes/obstacle/radiation/radiation.gd
Normal file
6
scenes/obstacle/radiation/radiation.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class_name Radiation extends "res://scenes/obstacle/obstacle.gd"
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
for i: Spaceship in $range.get_overlapping_bodies():
|
||||
i.applyRadiation(damage)
|
||||
1
scenes/obstacle/radiation/radiation.gd.uid
Normal file
1
scenes/obstacle/radiation/radiation.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cf6le506yx5kl
|
||||
49
scenes/obstacle/radiation/radiation.gdshader
Normal file
49
scenes/obstacle/radiation/radiation.gdshader
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform float time : hint_range(0.0, 10.0);
|
||||
|
||||
float snoise(vec3 uv, float res)
|
||||
{
|
||||
const vec3 s = vec3(1e0, 1e2, 1e3);
|
||||
uv *= res;
|
||||
|
||||
vec3 uv0 = floor(mod(uv, res)) * s;
|
||||
vec3 uv1 = floor(mod(uv + vec3(1.0), res)) * s;
|
||||
|
||||
vec3 f = fract(uv);
|
||||
f = f * f * (3.0 - 2.0 * f);
|
||||
|
||||
vec4 v = vec4(uv0.x + uv0.y + uv0.z, uv1.x + uv0.y + uv0.z,
|
||||
uv0.x + uv1.y + uv0.z, uv1.x + uv1.y + uv0.z);
|
||||
|
||||
vec4 r = fract(sin(v * 1e-1) * 1e3);
|
||||
float r0 = mix(mix(r.x, r.y, f.x), mix(r.z, r.w, f.x), f.y);
|
||||
|
||||
r = fract(sin((v + uv1.z - uv0.z) * 1e-1) * 1e3);
|
||||
float r1 = mix(mix(r.x, r.y, f.x), mix(r.z, r.w, f.x), f.y);
|
||||
|
||||
return mix(r0, r1, f.z) * 2.0 - 1.0;
|
||||
}
|
||||
|
||||
void fragment()
|
||||
{
|
||||
// Calcular las coordenadas de la pantalla usando SCREEN_PIXEL_SIZE
|
||||
vec2 screen_size = vec2(1.0 / SCREEN_PIXEL_SIZE.x, 1.0 / SCREEN_PIXEL_SIZE.y);
|
||||
vec2 fragCoord = FRAGCOORD.xy;
|
||||
|
||||
vec2 p = -0.5 + fragCoord.xy / screen_size;
|
||||
p.x *= screen_size.x / screen_size.y;
|
||||
|
||||
float color = 3.0 - (3.0 * length(2.0 * p));
|
||||
|
||||
vec3 coord = vec3(atan(p.x, p.y) / 6.2832 + 0.5, length(p) * 0.4, 0.5);
|
||||
|
||||
// if you dont want use gdscript to animate you can replace the 'time' to 'TIME'
|
||||
for (int i = 1; i <= 7; i++)
|
||||
{
|
||||
float power = pow(2.0, float(i));
|
||||
color += (1.5 / power) * snoise(coord + vec3(0.0, -time * 0.05, time * 0.01), power * 16.0);
|
||||
}
|
||||
|
||||
COLOR = vec4(color, pow(max(color, 0.0), 2.0) * 0.4, pow(max(color, 0.0), 3.0) * 0.15, 1.0);
|
||||
}
|
||||
1
scenes/obstacle/radiation/radiation.gdshader.uid
Normal file
1
scenes/obstacle/radiation/radiation.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bqato6xoe08xd
|
||||
57
scenes/obstacle/radiation/radiation.tscn
Normal file
57
scenes/obstacle/radiation/radiation.tscn
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://dhkcgxwakdha7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cgqo1nxq6xprm" path="res://scenes/obstacle/obstacle.tscn" id="1_0jyim"]
|
||||
[ext_resource type="Script" uid="uid://cf6le506yx5kl" path="res://scenes/obstacle/radiation/radiation.gd" id="2_7r84j"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfwyw1sr6x2np" path="res://icon.svg" id="3_o6dqs"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwnpsmrwskrgh" path="res://assets/radiation.png" id="4_pc435"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_7r84j"]
|
||||
radius = 64.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_as1jp"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_pc435"]
|
||||
radius = 192.0
|
||||
|
||||
[node name="Radiation" instance=ExtResource("1_0jyim")]
|
||||
collision_layer = 128
|
||||
collision_mask = 44
|
||||
script = ExtResource("2_7r84j")
|
||||
damage = 1
|
||||
lifeTime = 180
|
||||
|
||||
[node name="CollisionShape2D" parent="DamageArea" index="0"]
|
||||
shape = SubResource("CircleShape2D_7r84j")
|
||||
disabled = true
|
||||
|
||||
[node name="CollisionShape2D" parent="hurtArea" index="0"]
|
||||
disabled = true
|
||||
|
||||
[node name="Sprite2D" parent="." index="3"]
|
||||
visible = false
|
||||
material = SubResource("ShaderMaterial_as1jp")
|
||||
texture = ExtResource("3_o6dqs")
|
||||
|
||||
[node name="range" type="Area2D" parent="." index="6"]
|
||||
collision_layer = 128
|
||||
collision_mask = 40
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="range" index="0"]
|
||||
shape = SubResource("CircleShape2D_pc435")
|
||||
|
||||
[node name="CPUParticles2D" type="CPUParticles2D" parent="." index="7"]
|
||||
amount = 100
|
||||
texture = ExtResource("4_pc435")
|
||||
lifetime = 1.8
|
||||
speed_scale = 0.1
|
||||
randomness = 1.0
|
||||
spread = 180.0
|
||||
gravity = Vector2(0, 0)
|
||||
initial_velocity_min = 100.0
|
||||
initial_velocity_max = 100.0
|
||||
angle_max = 720.0
|
||||
scale_amount_min = 0.8
|
||||
scale_amount_max = 1.2
|
||||
|
||||
[editable path="DamageArea"]
|
||||
[editable path="hurtArea"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue