generated from MechanicalFlower/godot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add speed boost areas in races (#43)
* feat: add speed boost areas in races * chore: add changelog entry
- Loading branch information
1 parent
3a391df
commit 3cccf80
Showing
23 changed files
with
279 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[remap] | ||
|
||
importer="oggvorbisstr" | ||
type="AudioStreamOggVorbis" | ||
uid="uid://5o2mnxsagwq1" | ||
path="res://.godot/imported/boost.ogg-94c400d1a8bbbf61e00982a73ca9efe8.oggvorbisstr" | ||
|
||
[deps] | ||
|
||
source_file="res://assets/sounds/boost.ogg" | ||
dest_files=["res://.godot/imported/boost.ogg-94c400d1a8bbbf61e00982a73ca9efe8.oggvorbisstr"] | ||
|
||
[params] | ||
|
||
loop=false | ||
loop_offset=0 | ||
bpm=0 | ||
beat_count=0 | ||
bar_beats=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://768qm8vsl1un"] | ||
|
||
[ext_resource type="Shader" path="res://shaders/energy_shield.gdshader" id="1_gmgfm"] | ||
[ext_resource type="Script" path="res://scripts/boost.gd" id="1_rrijl"] | ||
[ext_resource type="AudioStream" uid="uid://5o2mnxsagwq1" path="res://assets/sounds/boost.ogg" id="3_serww"] | ||
|
||
[sub_resource type="SphereMesh" id="SphereMesh_yntlh"] | ||
radial_segments = 8 | ||
rings = 4 | ||
|
||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_nfirf"] | ||
render_priority = 0 | ||
shader = ExtResource("1_gmgfm") | ||
shader_parameter/_shield_color = Color(0, 0, 1, 1) | ||
shader_parameter/_shield_color_brightness = 10.0 | ||
shader_parameter/_shield_intensity = 2.0 | ||
shader_parameter/_rotation = Vector3(0.1, 0, 0) | ||
shader_parameter/_shield_size = 0.0 | ||
shader_parameter/_shield_pulse_frequency = 1.0 | ||
shader_parameter/_shield_pulse_density = 1.0 | ||
shader_parameter/_shield_pulse_amplitude = 1.0 | ||
shader_parameter/_shield_pulse_blend = 1.0 | ||
shader_parameter/_shield_pulse_radius = 1.0 | ||
shader_parameter/_impact_origin = Vector3(1, 0, 0) | ||
shader_parameter/_impact_frequency = 5.0 | ||
shader_parameter/_impact_density = 5.0 | ||
shader_parameter/_impact_amplitude = 6.0 | ||
shader_parameter/_impact_blend = 0.0 | ||
shader_parameter/_impact_radius = 1.1 | ||
shader_parameter/_impact_anim = 0.0 | ||
|
||
[sub_resource type="SphereShape3D" id="SphereShape3D_hmxdj"] | ||
|
||
[node name="Boost" type="Node3D"] | ||
script = ExtResource("1_rrijl") | ||
|
||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."] | ||
mesh = SubResource("SphereMesh_yntlh") | ||
surface_material_override/0 = SubResource("ShaderMaterial_nfirf") | ||
|
||
[node name="Area3D" type="Area3D" parent="."] | ||
collision_layer = 8 | ||
collision_mask = 4 | ||
monitorable = false | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"] | ||
shape = SubResource("SphereShape3D_hmxdj") | ||
|
||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."] | ||
stream = ExtResource("3_serww") | ||
unit_size = 1.0 | ||
|
||
[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@tool | ||
extends Node3D | ||
|
||
const Group := preload("res://scripts/constants/groups.gd") | ||
const CollisionLayers := preload("res://scripts/constants/collision_layers.gd") | ||
|
||
@export var active: bool: | ||
set = activate, | ||
get = is_activated | ||
|
||
@onready var area: Area3D = get_node(^"Area3D") | ||
@onready var audio: AudioStreamPlayer3D = get_node(^"AudioStreamPlayer3D") | ||
|
||
|
||
func _ready(): | ||
activate(false) | ||
|
||
area.collision_layer = 1 << CollisionLayers.BOOSTS | ||
area.collision_mask = 1 << CollisionLayers.MARBLES | ||
|
||
|
||
func activate(val) -> void: | ||
set_visible(val) | ||
area.set_monitoring(val) | ||
|
||
|
||
func is_activated() -> bool: | ||
return is_visible() | ||
|
||
|
||
func _on_area_3d_body_entered(body): | ||
if body.is_in_group(Group.MARBLES): | ||
body.linear_velocity *= 2 | ||
audio.play() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
const PROPS := 0 | ||
const CONNECTION_AREAS := 1 | ||
const MARBLES := 2 | ||
const BOOSTS := 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.