I have a simple function that calls other functions:
function update() {
updateMissiles();
updatePlayer;
updateTurbines();
}
They are similar to each other in every way except updatePlayer will not run if I put brackets on the end of it. This doesn't break any code but I'm still curious why it does that?
updatePlayer, it's impossible to say much. But a function won't run unless it's called, and calling a function means().updatePlayer? What do you meand by "updatePlayer will not run" and how you check if it has been run?updatePlayeris not a function by the timeupdateexecutes. Just beforeupdatePlayer, writeconsole.log(updatePlayer)to see what the value is.