Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

since you are unwilling to seek game development education elsewhere i will do it myself because i am bored, I am unsure of your level so i will start with the basics

this is a function call 

void Update(){if(health==0){SceneManagement.LoadScene(0);} }

the function call part of it is this

 void Update(){}

anything inside the brackets  (these--> {}) will happen every time the function is called in this case the function is update which basically means it runs every frame 

next up are if statements

if statements are the simplest form of code, basically if these conditions are met than this happens Im sure you can look at the if statement in my example and figure out scene number zero is a game over screen

the syntax (basically grammar for code) is different for every code language but it always works the same, consult your documentation ( game developer playbook) heres the scripting documentation for your game engine https://docs.godotengine.org/en/stable/tutorials/scripting/index.html 

please go make some human made slop with heart and soul in it