Is there any way to reset my program with hitting a button? (Reset deleted enemies etc)
You can use SceneTree.reloadcurrentscene() when you want to reset the game.
For example, to reset when hitting "Escape":
it served me, and another query, how do I add a point to a variable when I kill an enemy with collisions?
func _on_VisibilityNotifier2D_screen_exited ():
You just want to add one to a variable?
variable_name += 1
no, I want it to detect when an enemy is eliminated with
and if it was eliminated add a point to a varieble, will I explain?
I see. But where is the variable? Without knowing that, I can think of a couple of solutions:
1) In a singleton - call it directly:
autoload_name.points += 1
2) In a "main" or "world" scene - emit a signal:
Make sure that signal is connected to the main scene:
points += 1
Thanks, it worked!
And, another question, how do I make an enemy move randomly? type space invader that ships move to the right and left randomly mind
You should open a new question if you have a different topic.
I'll open it right now, go answer it