game: use shader instead of sprite for xp orbs

This commit is contained in:
2025-08-21 10:59:50 +02:00
parent 9240413da7
commit 3e12c386c2
3 changed files with 44 additions and 5 deletions

View File

@@ -1,17 +1,31 @@
[gd_scene load_steps=4 format=3 uid="uid://du4dqne3o0d5b"]
[gd_scene load_steps=7 format=3 uid="uid://du4dqne3o0d5b"]
[ext_resource type="Script" uid="uid://bx43us4qd2vpf" path="res://scenes/xp_orb.gd" id="1_me6n8"]
[ext_resource type="Texture2D" uid="uid://c0g255217x10l" path="res://assets/sprites/xp_orb_small.png" id="2_me6n8"]
[ext_resource type="Shader" uid="uid://ckjyt0mt0ngk" path="res://assets/shaders/xp_orb.gdshader" id="2_me6n8"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pkphv"]
shader = ExtResource("2_me6n8")
shader_parameter/orb_color = Color(0.2, 1, 0.5, 1)
shader_parameter/glow_strength = 1.0
shader_parameter/pulse_speed = 2.0
[sub_resource type="Gradient" id="Gradient_me6n8"]
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_hluwh"]
gradient = SubResource("Gradient_me6n8")
width = 12
height = 12
[sub_resource type="CircleShape2D" id="CircleShape2D_me6n8"]
radius = 5.0
radius = 4.0
[node name="XPOrb" type="Node2D" groups=["pickup", "xp_orb"]]
script = ExtResource("1_me6n8")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-1, 1)
texture = ExtResource("2_me6n8")
material = SubResource("ShaderMaterial_pkphv")
texture = SubResource("GradientTexture2D_hluwh")
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 9