mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-13 05:52:24 +02:00
Minor Cleanup
- Renamed SoundController - Cleaned up spacings - File endings
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
extends StaticBody2D
|
||||
|
||||
export(int,1,10) var health = 1
|
||||
export(int, 1, 10) var health = 1
|
||||
var GreenDrop = 0.4
|
||||
var BlueDrop = 0.5
|
||||
var RedDrop = 0.8
|
||||
var Heart = 0.2
|
||||
|
||||
|
||||
func offset_vec():
|
||||
var offset = 16
|
||||
return Vector2((randf()-0.5)*offset, (randf()-0.5)*offset)
|
||||
|
||||
|
||||
func _on_Hurtbox_area_entered(area):
|
||||
health -= area.damage
|
||||
if(health>0):
|
||||
@@ -20,8 +22,8 @@ func _on_Hurtbox_area_entered(area):
|
||||
var BlueRubies = load("res://Objects/Rubies/Blue.tscn")
|
||||
var RedRubies = load("res://Objects/Rubies/Red.tscn")
|
||||
var Hearts = load("res://Objects/Heart/Heart.tscn")
|
||||
|
||||
#index of ysort
|
||||
|
||||
# index of ysort
|
||||
var world = get_tree().current_scene.get_node("YSort")
|
||||
if(randf()<GreenDrop):
|
||||
var green = GreenRubies.instance()
|
||||
@@ -39,4 +41,3 @@ func _on_Hurtbox_area_entered(area):
|
||||
var heart = Hearts.instance()
|
||||
world.add_child(heart)
|
||||
heart.global_position = global_position+offset_vec()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user