Skip to content

Commit

Permalink
Add particles
Browse files Browse the repository at this point in the history
  • Loading branch information
Killarexe committed May 11, 2024
1 parent 2e96040 commit 30115f6
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 31 deletions.
60 changes: 30 additions & 30 deletions assets/style/default_theme.tres

Large diffs are not rendered by default.

Binary file added assets/textures/player/particles/stone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/textures/player/particles/stone.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://djrkeg36vcxi5"
path="res://.godot/imported/stone.png-47c384173b672731fafffe2fc97748a6.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/textures/player/particles/stone.png"
dest_files=["res://.godot/imported/stone.png-47c384173b672731fafffe2fc97748a6.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
27 changes: 27 additions & 0 deletions data/particles/rainbow_jump.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="PlayerParticle" load_steps=5 format=3 uid="uid://cq5ytqw550ds2"]

[ext_resource type="Script" path="res://scripts/level/player/cosmetic/particle/PlayerParticle.gd" id="1_hyp76"]

[sub_resource type="Gradient" id="Gradient_shl4q"]
offsets = PackedFloat32Array(0, 0.25969, 0.515504, 0.744186, 1)
colors = PackedColorArray(1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_hvwyd"]
gradient = SubResource("Gradient_shl4q")

[sub_resource type="ParticleProcessMaterial" id="3"]
lifetime_randomness = 1.0
emission_shape = 3
emission_box_extents = Vector3(10, 1, 1)
spread = 180.0
flatness = 1.0
gravity = Vector3(0, -1, 0)
color_ramp = SubResource("GradientTexture1D_hvwyd")

[resource]
script = ExtResource("1_hyp76")
type = 1
material = SubResource("3")
name = "particle.rainbow_jump"
chance = 1
is_hidden = false
27 changes: 27 additions & 0 deletions data/particles/rainbow_step.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="PlayerParticle" load_steps=5 format=3 uid="uid://qgtgmaflia7h"]

[ext_resource type="Script" path="res://scripts/level/player/cosmetic/particle/PlayerParticle.gd" id="1_p50k7"]

[sub_resource type="Gradient" id="Gradient_shl4q"]
offsets = PackedFloat32Array(0, 0.25969, 0.515504, 0.744186, 1)
colors = PackedColorArray(1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_3jcsd"]
gradient = SubResource("Gradient_shl4q")

[sub_resource type="ParticleProcessMaterial" id="3"]
lifetime_randomness = 1.0
emission_shape = 3
emission_box_extents = Vector3(3, 1, 1)
spread = 180.0
flatness = 1.0
gravity = Vector3(0, -10, 0)
color_ramp = SubResource("GradientTexture1D_3jcsd")

[resource]
script = ExtResource("1_p50k7")
type = 0
material = SubResource("3")
name = "particle.rainbow_step"
chance = 1
is_hidden = false
31 changes: 31 additions & 0 deletions data/particles/stone_jump.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[gd_resource type="Resource" script_class="PlayerParticle" load_steps=6 format=3 uid="uid://cklnjbbt6srld"]

[ext_resource type="Script" path="res://scripts/level/player/cosmetic/particle/PlayerParticle.gd" id="1_sll7j"]
[ext_resource type="Texture2D" uid="uid://djrkeg36vcxi5" path="res://assets/textures/player/particles/stone.png" id="2_nv8sg"]

[sub_resource type="Gradient" id="1"]
offsets = PackedFloat32Array(0.572368, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)

[sub_resource type="GradientTexture2D" id="2"]
gradient = SubResource("1")

[sub_resource type="ParticleProcessMaterial" id="3"]
lifetime_randomness = 1.0
emission_shape = 3
emission_box_extents = Vector3(10, 1, 1)
spread = 180.0
flatness = 1.0
gravity = Vector3(0, -1, 0)
scale_min = 0.25
scale_max = 0.5
color_ramp = SubResource("2")

[resource]
script = ExtResource("1_sll7j")
type = 1
material = SubResource("3")
name = "particle.stone_jump"
chance = 1
is_hidden = false
texture = ExtResource("2_nv8sg")
31 changes: 31 additions & 0 deletions data/particles/stone_step.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[gd_resource type="Resource" script_class="PlayerParticle" load_steps=6 format=3 uid="uid://blmilyrfrgevf"]

[ext_resource type="Script" path="res://scripts/level/player/cosmetic/particle/PlayerParticle.gd" id="1_8ck5f"]
[ext_resource type="Texture2D" uid="uid://djrkeg36vcxi5" path="res://assets/textures/player/particles/stone.png" id="2_tk76f"]

[sub_resource type="Gradient" id="1"]
offsets = PackedFloat32Array(0.572368, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)

[sub_resource type="GradientTexture2D" id="2"]
gradient = SubResource("1")

[sub_resource type="ParticleProcessMaterial" id="3"]
lifetime_randomness = 1.0
emission_shape = 3
emission_box_extents = Vector3(3, 1, 1)
spread = 180.0
flatness = 1.0
gravity = Vector3(0, -10, 0)
scale_min = 0.25
scale_max = 0.5
color_ramp = SubResource("2")

[resource]
script = ExtResource("1_8ck5f")
type = 0
material = SubResource("3")
name = "particle.stone_step"
chance = 1
is_hidden = false
texture = ExtResource("2_tk76f")
2 changes: 1 addition & 1 deletion scripts/level/player/PlayerControllerComponent.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func check_input() -> void:

if Input.is_action_pressed("jump"):
jump_timer = JUMP_TIME

if jump_timer > 0 && !Input.is_action_pressed("jump"):
jump_timer = 0
if(player.motion.y < 0):
Expand Down
Empty file modified scripts/uis/main_menu/MainMenu.gd
100755 → 100644
Empty file.

0 comments on commit 30115f6

Please sign in to comment.