Quote: "why?"
by experience. its difficult to explain in english.
global variables are often used inside a function, you lost overview what arguments get in, they are shared , if you will use the function as template somewhere else
you must search the spread source code in project.
if the function write values into this global variable it can break the logic if other function call write also a value into.
if you call a function for player1 and player2 and they wrote a value into it may result in a conflict.
a real example,
we had a web developer that used global variables for project, order no., order pos. which changed after selecting comboboxes. (designed for single window long ago)
now think what happened if the user open a new window (window 2) , change the comboboxes there and he save the data in the other data collect windows (window 1)
which used global variables. yeahh the supplier collect wrong data. arrrggrgrgr.
next real example if you are using objects.
if you are using global variables for database write access,
if the function which edit data not closing this recordset maybe the database table is unwanted locked or you end up in a deadlock.
would you use a recordset inside the function scope, the object will run through a destructor process.
Quote: "It is more efficient than passing variables to every function"
as well, that is part of optimization solution.
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)