arrows now get deleted when offscreen

This commit is contained in:
pennyrigate 2022-12-19 16:41:00 -05:00
parent 2d3fc72ebe
commit b53c776021
4 changed files with 21 additions and 8 deletions

View file

@ -28,15 +28,21 @@ onready var a_shoot = preload("res://audio/sounds/a_egg_shoot.ogg")
#Objects
onready var block_text = preload("res://objects/hud/blocktext.tscn")
#Instances a node
func instance_node(node:PackedScene,x:float,y:float,parent):
var Instance = node.instance()
Instance.global_position = Vector2(x,y)
parent.add_child(Instance)
#Plays a sound
func play_sound(snd,player):
player.set_stream(snd)
player._set_playing(true)
#Get position in sectors
func get_sector(pos):
return (pos / resolution).floor()
func _process(delta):
#Restart scene
if Input.is_action_just_pressed("debug_restart"):