generated from krampus/template-godot4
	Compare commits
	
		
			4 Commits
		
	
	
		
			6abbe7f82a
			...
			37edad916b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 37edad916b | |||
| e7c659e5dc | |||
| a65d08599f | |||
| 5c3da56226 | 
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								assets/sprites/particles/ball.png
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/sprites/particles/ball.png
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										34
									
								
								assets/sprites/particles/ball.png.import
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								assets/sprites/particles/ball.png.import
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| [remap] | ||||
| 
 | ||||
| importer="texture" | ||||
| type="CompressedTexture2D" | ||||
| uid="uid://dtsdecae83ah3" | ||||
| path="res://.godot/imported/ball.png-9141da4d584001e11280d9c246b59589.ctex" | ||||
| metadata={ | ||||
| "vram_texture": false | ||||
| } | ||||
| 
 | ||||
| [deps] | ||||
| 
 | ||||
| source_file="res://assets/sprites/particles/ball.png" | ||||
| dest_files=["res://.godot/imported/ball.png-9141da4d584001e11280d9c246b59589.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=true | ||||
| 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 | ||||
| @ -11,3 +11,6 @@ func _collect(player: WorldPlayer) -> void: | ||||
| 		player.set_balls(ball_type, -1) | ||||
| 	else: | ||||
| 		player.mutate_balls(ball_type, amount) | ||||
| 
 | ||||
| 	player.shot_setup.hud.peek_club_selector() | ||||
| 	player.shot_setup.hud.ball_particles.emit_spatial(maxi(amount, 1), global_position) | ||||
|  | ||||
| @ -1,10 +1,11 @@ | ||||
| [gd_scene load_steps=29 format=3 uid="uid://comd88yp45mnb"] | ||||
| [gd_scene load_steps=30 format=3 uid="uid://comd88yp45mnb"] | ||||
| 
 | ||||
| [ext_resource type="PackedScene" uid="uid://djfbit4v0qncc" path="res://assets/models/items/octahedron.gltf" id="1_a0q17"] | ||||
| [ext_resource type="Script" path="res://src/items/item/item.gd" id="1_kesm6"] | ||||
| [ext_resource type="Material" uid="uid://c5hidbq5gbmr" path="res://assets/materials/crystal.tres" id="2_dtimm"] | ||||
| [ext_resource type="Shader" path="res://src/shaders/spatial_shine.gdshader" id="5_hvjqo"] | ||||
| [ext_resource type="Texture2D" uid="uid://du3vk5nnksohs" path="res://assets/sprites/particles/sparkle.png" id="5_k1sdu"] | ||||
| [ext_resource type="AudioStream" uid="uid://8uynlpios7u1" path="res://assets/sound/sfx/ui/ecofuture2.wav" id="6_f5kbg"] | ||||
| 
 | ||||
| [sub_resource type="Animation" id="Animation_7sxyq"] | ||||
| length = 0.001 | ||||
| @ -323,6 +324,51 @@ tracks/2/keys = { | ||||
| "update": 1, | ||||
| "values": [true] | ||||
| } | ||||
| tracks/3/type = "bezier" | ||||
| tracks/3/imported = false | ||||
| tracks/3/enabled = true | ||||
| tracks/3/path = NodePath("Pivot/Octahedron/ItemMeshContainer:scale:x") | ||||
| tracks/3/interp = 1 | ||||
| tracks/3/loop_wrap = true | ||||
| tracks/3/keys = { | ||||
| "handle_modes": PackedInt32Array(0), | ||||
| "points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), | ||||
| "times": PackedFloat32Array(0) | ||||
| } | ||||
| tracks/4/type = "bezier" | ||||
| tracks/4/imported = false | ||||
| tracks/4/enabled = true | ||||
| tracks/4/path = NodePath("Pivot/Octahedron/ItemMeshContainer:scale:y") | ||||
| tracks/4/interp = 1 | ||||
| tracks/4/loop_wrap = true | ||||
| tracks/4/keys = { | ||||
| "handle_modes": PackedInt32Array(0), | ||||
| "points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), | ||||
| "times": PackedFloat32Array(0) | ||||
| } | ||||
| tracks/5/type = "bezier" | ||||
| tracks/5/imported = false | ||||
| tracks/5/enabled = true | ||||
| tracks/5/path = NodePath("Pivot/Octahedron/ItemMeshContainer:scale:z") | ||||
| tracks/5/interp = 1 | ||||
| tracks/5/loop_wrap = true | ||||
| tracks/5/keys = { | ||||
| "handle_modes": PackedInt32Array(0), | ||||
| "points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), | ||||
| "times": PackedFloat32Array(0) | ||||
| } | ||||
| tracks/6/type = "value" | ||||
| tracks/6/imported = false | ||||
| tracks/6/enabled = true | ||||
| tracks/6/path = NodePath("CollectionChime:playing") | ||||
| tracks/6/interp = 1 | ||||
| tracks/6/loop_wrap = true | ||||
| tracks/6/keys = { | ||||
| "times": PackedFloat32Array(0), | ||||
| "transitions": PackedFloat32Array(1), | ||||
| "update": 1, | ||||
| "values": [false] | ||||
| } | ||||
| 
 | ||||
| [sub_resource type="Animation" id="Animation_niure"] | ||||
| resource_name = "explode" | ||||
| @ -377,6 +423,51 @@ tracks/3/keys = { | ||||
| "method": &"queue_free" | ||||
| }] | ||||
| } | ||||
| tracks/4/type = "bezier" | ||||
| tracks/4/imported = false | ||||
| tracks/4/enabled = true | ||||
| tracks/4/path = NodePath("Pivot/Octahedron/ItemMeshContainer:scale:x") | ||||
| tracks/4/interp = 1 | ||||
| tracks/4/loop_wrap = true | ||||
| tracks/4/keys = { | ||||
| "handle_modes": PackedInt32Array(0, 0), | ||||
| "points": PackedFloat32Array(1, -0.25, 0, 0.2, 0.8, 0.001, -0.25, 0, 0.25, 0), | ||||
| "times": PackedFloat32Array(0.0333333, 0.333333) | ||||
| } | ||||
| tracks/5/type = "bezier" | ||||
| tracks/5/imported = false | ||||
| tracks/5/enabled = true | ||||
| tracks/5/path = NodePath("Pivot/Octahedron/ItemMeshContainer:scale:y") | ||||
| tracks/5/interp = 1 | ||||
| tracks/5/loop_wrap = true | ||||
| tracks/5/keys = { | ||||
| "handle_modes": PackedInt32Array(0, 0), | ||||
| "points": PackedFloat32Array(1, -0.25, 0, 0.2, 0.8, 0.001, -0.25, 0, 0.25, 0), | ||||
| "times": PackedFloat32Array(0, 0.3) | ||||
| } | ||||
| tracks/6/type = "bezier" | ||||
| tracks/6/imported = false | ||||
| tracks/6/enabled = true | ||||
| tracks/6/path = NodePath("Pivot/Octahedron/ItemMeshContainer:scale:z") | ||||
| tracks/6/interp = 1 | ||||
| tracks/6/loop_wrap = true | ||||
| tracks/6/keys = { | ||||
| "handle_modes": PackedInt32Array(0, 0), | ||||
| "points": PackedFloat32Array(1, -0.25, 0, 0.2, 0.8, 0.001, -0.25, 0, 0.25, 0), | ||||
| "times": PackedFloat32Array(0.0666667, 0.366667) | ||||
| } | ||||
| tracks/7/type = "value" | ||||
| tracks/7/imported = false | ||||
| tracks/7/enabled = true | ||||
| tracks/7/path = NodePath("CollectionChime:playing") | ||||
| tracks/7/interp = 1 | ||||
| tracks/7/loop_wrap = true | ||||
| tracks/7/keys = { | ||||
| "times": PackedFloat32Array(0), | ||||
| "transitions": PackedFloat32Array(1), | ||||
| "update": 1, | ||||
| "values": [true] | ||||
| } | ||||
| 
 | ||||
| [sub_resource type="AnimationLibrary" id="AnimationLibrary_lqra6"] | ||||
| _data = { | ||||
| @ -445,6 +536,10 @@ libraries = { | ||||
| "": SubResource("AnimationLibrary_lqra6") | ||||
| } | ||||
| 
 | ||||
| [node name="CollectionChime" type="AudioStreamPlayer" parent="."] | ||||
| stream = ExtResource("6_f5kbg") | ||||
| bus = &"SFX" | ||||
| 
 | ||||
| [connection signal="body_entered" from="Pivot/CollectionArea" to="." method="_on_collection_area_body_entered"] | ||||
| 
 | ||||
| [editable path="Pivot/Octahedron"] | ||||
|  | ||||
| @ -30,8 +30,6 @@ signal on_death(player: WorldPlayer) | ||||
| 	GameBall.Type.PLASMA: -1, | ||||
| } | ||||
| 
 | ||||
| # TODO balls, pickups, etc | ||||
| 
 | ||||
| var shot_setup: ShotSetup: | ||||
| 	get: | ||||
| 		if not shot_setup: | ||||
|  | ||||
							
								
								
									
										22
									
								
								src/ui/decorations/hud_particles/hud_particles.gd
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/ui/decorations/hud_particles/hud_particles.gd
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | ||||
| class_name HUDParticles extends GPUParticles2D | ||||
| ## 2D particle emitter with spatial logic, for emitting particles in the HUD. | ||||
| 
 | ||||
| 
 | ||||
| ## Emit the given number of particles in one shot. | ||||
| func emit(_amount: int) -> void: | ||||
| 	amount = _amount | ||||
| 	emitting = true | ||||
| 
 | ||||
| 
 | ||||
| ## Emit the given number of particles from the given screen location. | ||||
| func emit_at_location(_amount: int, source_location: Vector2) -> void: | ||||
| 	var particle_mat: ParticleProcessMaterial = process_material | ||||
| 	particle_mat.emission_shape_offset = Vector3(source_location.x, source_location.y, 0) | ||||
| 	emit(_amount) | ||||
| 
 | ||||
| 
 | ||||
| ## Emit the given number of particles from the screen location of the given point in 3D space. | ||||
| func emit_spatial(_amount: int, source_location: Vector3) -> void: | ||||
| 	var screen_location := get_viewport().get_camera_3d().unproject_position(source_location) | ||||
| 	# TODO: what to do if this is outside the viewport? | ||||
| 	emit_at_location(_amount, screen_location) | ||||
							
								
								
									
										50
									
								
								src/ui/decorations/hud_particles/hud_particles.tscn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								src/ui/decorations/hud_particles/hud_particles.tscn
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,50 @@ | ||||
| [gd_scene load_steps=9 format=3 uid="uid://dfh0bv7lwewj5"] | ||||
| 
 | ||||
| [ext_resource type="Script" path="res://src/ui/decorations/hud_particles/hud_particles.gd" id="1_leh7k"] | ||||
| 
 | ||||
| [sub_resource type="Curve" id="Curve_mp3bg"] | ||||
| max_value = 100.0 | ||||
| _data = [Vector2(0.0431211, 0), 0.0, 21.2919, 0, 0, Vector2(1, 100), 336.968, 0.0, 0, 0] | ||||
| point_count = 2 | ||||
| 
 | ||||
| [sub_resource type="CurveTexture" id="CurveTexture_satut"] | ||||
| curve = SubResource("Curve_mp3bg") | ||||
| 
 | ||||
| [sub_resource type="Curve" id="Curve_a5ydw"] | ||||
| max_value = 200.0 | ||||
| _data = [Vector2(0, 9.02831), 0.0, 0.618766, 0, 0, Vector2(1, 200), 450.985, 0.0, 0, 0] | ||||
| point_count = 2 | ||||
| 
 | ||||
| [sub_resource type="CurveTexture" id="CurveTexture_oynpa"] | ||||
| curve = SubResource("Curve_a5ydw") | ||||
| 
 | ||||
| [sub_resource type="Curve" id="Curve_53gso"] | ||||
| _data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.0616016, 1), 0.0, 0.0, 0, 0, Vector2(0.761807, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] | ||||
| point_count = 4 | ||||
| 
 | ||||
| [sub_resource type="CurveTexture" id="CurveTexture_a05qh"] | ||||
| curve = SubResource("Curve_53gso") | ||||
| 
 | ||||
| [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_besmx"] | ||||
| particle_flag_disable_z = true | ||||
| direction = Vector3(0, 0, 0) | ||||
| spread = 180.0 | ||||
| initial_velocity_min = 400.0 | ||||
| initial_velocity_max = 600.0 | ||||
| gravity = Vector3(0, 0, 0) | ||||
| radial_accel_min = -100.0 | ||||
| radial_accel_max = -100.0 | ||||
| radial_accel_curve = SubResource("CurveTexture_oynpa") | ||||
| damping_min = 200.0 | ||||
| damping_max = 200.0 | ||||
| damping_curve = SubResource("CurveTexture_satut") | ||||
| scale_curve = SubResource("CurveTexture_a05qh") | ||||
| 
 | ||||
| [node name="HUDParticles" type="GPUParticles2D"] | ||||
| emitting = false | ||||
| amount = 32 | ||||
| process_material = SubResource("ParticleProcessMaterial_besmx") | ||||
| lifetime = 1.4 | ||||
| one_shot = true | ||||
| explosiveness = 0.7 | ||||
| script = ExtResource("1_leh7k") | ||||
| @ -16,6 +16,7 @@ var player: WorldPlayer | ||||
| 
 | ||||
| @onready var club_selector: ClubSelector = %ClubSelector | ||||
| @onready var ball_selector: BallSelector = %BallSelector | ||||
| @onready var ball_particles: HUDParticles = %BallParticles | ||||
| 
 | ||||
| @onready var _curve_animation: AnimationPlayer = %CurveAnimation | ||||
| @onready var _power_animation: AnimationPlayer = %PowerAnimation | ||||
| @ -57,6 +58,10 @@ func hide_hud() -> void: | ||||
| 	_sw_animation.play("hide") | ||||
| 
 | ||||
| 
 | ||||
| func peek_club_selector() -> void: | ||||
| 	_club_selector_animation.play("peek") | ||||
| 
 | ||||
| 
 | ||||
| func peek_life_bar() -> void: | ||||
| 	_sw_animation.play("peek") | ||||
| 
 | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| [gd_scene load_steps=41 format=3 uid="uid://c4ifdiohng830"] | ||||
| [gd_scene load_steps=44 format=3 uid="uid://c4ifdiohng830"] | ||||
| 
 | ||||
| [ext_resource type="Script" path="res://src/ui/shot_hud/shot_hud.gd" id="1_x5b4c"] | ||||
| [ext_resource type="Shader" path="res://src/shaders/canvas_retro.gdshader" id="1_ybxxp"] | ||||
| @ -12,6 +12,8 @@ | ||||
| [ext_resource type="FontFile" uid="uid://dsa0oh7c0h4pu" path="res://assets/fonts/Racing_Sans_One/RacingSansOne-Regular.ttf" id="8_bejx4"] | ||||
| [ext_resource type="Texture2D" uid="uid://tancoet1lih5" path="res://assets/ui/ball_icons/basic_icon.png" id="8_tt8i3"] | ||||
| [ext_resource type="PackedScene" uid="uid://dmciuk3pbjsae" path="res://src/ui/shot_hud/life_bar/life_bar.tscn" id="9_w1fiw"] | ||||
| [ext_resource type="PackedScene" uid="uid://dfh0bv7lwewj5" path="res://src/ui/decorations/hud_particles/hud_particles.tscn" id="11_ie5ih"] | ||||
| [ext_resource type="Texture2D" uid="uid://dtsdecae83ah3" path="res://assets/sprites/particles/ball.png" id="12_fdbqt"] | ||||
| [ext_resource type="PackedScene" uid="uid://b47goj32i6sdh" path="res://src/ui/elements/input_prompt/input_prompt.tscn" id="14_ik4gg"] | ||||
| 
 | ||||
| [sub_resource type="Animation" id="Animation_2gt87"] | ||||
| @ -282,6 +284,23 @@ tracks/0/keys = { | ||||
| "values": [0.0, 0.0872665, -1.5708] | ||||
| } | ||||
| 
 | ||||
| [sub_resource type="Animation" id="Animation_hmxtr"] | ||||
| resource_name = "peek" | ||||
| length = 2.4 | ||||
| step = 0.02 | ||||
| tracks/0/type = "value" | ||||
| tracks/0/imported = false | ||||
| tracks/0/enabled = true | ||||
| tracks/0/path = NodePath(".:rotation") | ||||
| tracks/0/interp = 3 | ||||
| tracks/0/loop_wrap = true | ||||
| tracks/0/keys = { | ||||
| "times": PackedFloat32Array(0, 0.14, 0.2, 2.2, 2.26, 2.4), | ||||
| "transitions": PackedFloat32Array(1.618, 1.618, 1, 1, 1.618, 1.618), | ||||
| "update": 0, | ||||
| "values": [-1.5708, 0.0872665, 0.0, 0.0, 0.0872665, -1.5708] | ||||
| } | ||||
| 
 | ||||
| [sub_resource type="Animation" id="Animation_x6kyr"] | ||||
| resource_name = "show" | ||||
| length = 0.4 | ||||
| @ -303,6 +322,7 @@ tracks/0/keys = { | ||||
| _data = { | ||||
| "RESET": SubResource("Animation_4h8gq"), | ||||
| "hide": SubResource("Animation_w7dmn"), | ||||
| "peek": SubResource("Animation_hmxtr"), | ||||
| "show": SubResource("Animation_x6kyr") | ||||
| } | ||||
| 
 | ||||
| @ -714,6 +734,20 @@ anchor_right = 0.7 | ||||
| offset_right = 108.0 | ||||
| grow_horizontal = 1 | ||||
| 
 | ||||
| [node name="BallParticleContainer" type="Control" parent="ClubSelector/TextureRect"] | ||||
| layout_mode = 1 | ||||
| anchors_preset = 8 | ||||
| anchor_left = 0.5 | ||||
| anchor_top = 0.5 | ||||
| anchor_right = 0.5 | ||||
| anchor_bottom = 0.5 | ||||
| grow_horizontal = 2 | ||||
| grow_vertical = 2 | ||||
| 
 | ||||
| [node name="BallParticles" parent="ClubSelector/TextureRect/BallParticleContainer" instance=ExtResource("11_ie5ih")] | ||||
| unique_name_in_owner = true | ||||
| texture = ExtResource("12_fdbqt") | ||||
| 
 | ||||
| [node name="SouthWest" type="MarginContainer" parent="."] | ||||
| layout_mode = 1 | ||||
| anchors_preset = -1 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user