-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started working on a background loader
- Loading branch information
Showing
26 changed files
with
293 additions
and
158 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ export_presets.cfg | |
data_*/ | ||
|
||
# Custom ignores | ||
.build/ | ||
Builds/ | ||
Media/ |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,40 @@ | ||
class_name HealthBar, "./HealthBar.svg" | ||
extends LabelRange | ||
|
||
signal death | ||
signal health_changed(health) | ||
|
||
export(float) var max_health: float setget set_max_health | ||
export(float) var current_health: float setget set_current_health | ||
export(bool) var always_visible: bool = false | ||
|
||
func is_dead()->bool: | ||
return current_health <= 0 | ||
|
||
func is_max_health()->bool: | ||
return current_health >= max_health | ||
|
||
func set_max_health(new_value: float)->void: | ||
max_health = new_value | ||
max_value = new_value | ||
set_current_health(current_health) | ||
|
||
func set_current_health(new_value: float)->void: | ||
current_health = clamp(new_value, 0, max_health) | ||
value = current_health/max_health * max_value | ||
visible = is_visible() | ||
if is_dead(): | ||
emit_signal("death") | ||
emit_signal("health_changed", current_health) | ||
|
||
func is_visible()->bool: | ||
return always_visible or !(is_max_health() or is_dead()) | ||
|
||
func remove_health(amount: float)->void: | ||
set_current_health(current_health - amount) | ||
|
||
func add_health(amount: float)->void: | ||
set_current_health(current_health + amount) | ||
|
||
func get_class()->String: | ||
return "HealthBar" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/HealthBar.svg-72b95c61a6db338f7a3f4dfd24471c04.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://Addons/SimpleNodes/HealthBar.svg" | ||
dest_files=[ "res://.import/HealthBar.svg-72b95c61a6db338f7a3f4dfd24471c04.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=false | ||
svg/scale=1.0 |
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,16 @@ | ||
class_name RandomStreamPlayer, "./RandomStreamPlayer.svg" | ||
extends AudioStreamPlayer | ||
|
||
export(Array, AudioStream) var samples = [] | ||
export(float, 0, 2) var min_pitch: = 1.0 | ||
export(float, 0, 2) var max_pitch: = 1.0 | ||
|
||
func play_random(from_position: float = 0.0)->void: | ||
var samples_size = samples.size() | ||
if samples_size > 0: | ||
stream = samples[randi() % samples_size] | ||
pitch_scale = wrapf(randf()*2.0, min_pitch, max_pitch) | ||
play(from_position) | ||
|
||
func get_class()->String: | ||
return "RandomStreamPlayer" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/RandomStreamPlayer.svg-89397f9824a2f06d60dc171b435309b7.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://Addons/SimpleNodes/RandomStreamPlayer.svg" | ||
dest_files=[ "res://.import/RandomStreamPlayer.svg-89397f9824a2f06d60dc171b435309b7.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=false | ||
svg/scale=1.0 |
File renamed without changes.
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,13 +1,12 @@ | ||
[gd_scene load_steps=3 format=2] | ||
|
||
[ext_resource path="res://Scripts/Global.gd" type="Script" id=1] | ||
[ext_resource path="res://Scenes/UI/TransitionScreen.tscn" type="PackedScene" id=2] | ||
[ext_resource path="res://Scenes/SceneTransition.tscn" type="PackedScene" id=2] | ||
|
||
[node name="Global" type="Node"] | ||
pause_mode = 2 | ||
script = ExtResource( 1 ) | ||
|
||
[node name="TransitionLayer" type="CanvasLayer" parent="."] | ||
layer = 3 | ||
[node name="OverlayLayer" type="CanvasLayer" parent="."] | ||
|
||
[node name="TransitionScreen" parent="TransitionLayer" instance=ExtResource( 2 )] | ||
[node name="SceneTransition" parent="OverlayLayer" instance=ExtResource( 2 )] |
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.