Skip to content

Commit

Permalink
Add rainbow explosion
Browse files Browse the repository at this point in the history
Credit to @PlayWithFurcifer for the [sprite sheet][1] and [tutorial][2]
that formed the basis of this explosion

I've made minor tweaks compared to the settings they used in the
tutorial, and had to work out how to translate the settings from the
Godot 3 `Particles2D` node to the Godot 4 `CPUParticles2D` node. Working
our how to add the texture was the trickiest part, but part of the
problem there was working out that it wanted an SVG, not a PNG. I
believe the Godot 3 `Particles2D` node is more equivalent to the Godot 4
`GPUParticles2D`, but [Godot crashes when trying to use this on a
project using the compatibility renderer on macOS][3]

[1]: https://github.com/PlayWithFurcifer/godot-particle-systems-guide/blob/main/Explosion_Sheet.png
[2]: https://www.youtube.com/watch?v=F1Fyj3Lh_Pc&t=253s
[3]: godotengine/godot#72469
  • Loading branch information
yndajas committed Oct 20, 2023
1 parent e0e9cb4 commit fb15297
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Making a game for The Queerness and Games Jam 2023
## Credits

[Flag sprites][flag-sprites] by [Rob Mocci][rob-mocci]
[Explosion sprite sheet][explosion-sprite-sheet] and [guide][explosion-tutorial] by [PlayWithFurcifer][play-with-furcifer]

[explosion-sprite-sheet]: https://github.com/PlayWithFurcifer/godot-particle-systems-guide/blob/main/Explosion_Sheet.png
[explosion-tutorial]: https://www.youtube.com/watch?v=F1Fyj3Lh_Pc&t=253s
[flag-sprites]: https://rmocci.itch.io/pixel-special
[play-with-furcifer]: https://github.com/PlayWithFurcifer
[rob-mocci]: https://rmocci.itch.io
4 changes: 4 additions & 0 deletions assets/images/sprites/explosion_sheet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions assets/images/sprites/explosion_sheet.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bc1djcrvyx3dk"
path="res://.godot/imported/explosion_sheet.svg-9bb92ba2f81415d87d1ef9bc9b9091f6.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/images/sprites/explosion_sheet.svg"
dest_files=["res://.godot/imported/explosion_sheet.svg-9bb92ba2f81415d87d1ef9bc9b9091f6.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
34 changes: 34 additions & 0 deletions scenes/explosion.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[gd_scene load_steps=4 format=3 uid="uid://n3fd71xert8q"]

[ext_resource type="Texture2D" uid="uid://bc1djcrvyx3dk" path="res://assets/images/sprites/explosion_sheet.svg" id="1_or2ic"]

[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_0noh1"]
particles_animation = true
particles_anim_h_frames = 5
particles_anim_v_frames = 1
particles_anim_loop = false

[sub_resource type="Gradient" id="Gradient_xr1od"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.0822086, 0.165563, 0.252761, 0.334969, 0.415951, 0.492025, 0.581595, 0.665031, 0.749693, 0.83681, 0.920245, 1)
colors = PackedColorArray(1, 1, 1, 1, 0.937255, 0.607843, 0.737255, 1, 0.847059, 0, 0.0745098, 1, 0.505882, 0.262745, 0.0705882, 1, 0.92549, 0.458824, 0.0784314, 1, 0.988235, 0.823529, 0.0823529, 1, 0.921569, 0.890196, 0.113725, 1, 0.403922, 0.682353, 0.12549, 1, 0.419608, 0.756863, 0.87451, 1, 0.133333, 0.262745, 0.576471, 1, 0.321569, 0.12549, 0.470588, 1, 0.34902, 0.0666667, 0.427451, 1, 0.0862745, 0.0862745, 0.0823529, 1)

[node name="CPUParticles2D" type="CPUParticles2D"]
material = SubResource("CanvasItemMaterial_0noh1")
lifetime = 0.5
one_shot = true
speed_scale = 0.5
explosiveness = 1.0
lifetime_randomness = 0.5
texture = ExtResource("1_or2ic")
emission_shape = 1
emission_sphere_radius = 128.0
gravity = Vector2(2.08165e-12, -50)
angular_velocity_max = 5.0
angle_min = -720.0
angle_max = 720.0
scale_amount_min = 3.0
scale_amount_max = 5.0
color_ramp = SubResource("Gradient_xr1od")
anim_speed_min = 1.0
anim_speed_max = 1.0

0 comments on commit fb15297

Please sign in to comment.