Game structure/layout

Can anyone please suggest good links/tutorial on good practices for layout and structuring your game, my stuff ends up turning into a big bowl of confusing spaghetti?

is it okay to pass variables between scripts or is this considered a bad practice?

I try to avoid it as much as possible…

If you have the financial possibility I would suggest you go grab:

gamedev.tv does solid courses with a lot of examples on structuring coding without too much clutter.

This dude on youtube does some solid game patterns, two especially useful ones are observer pattern and strategy pattern.

Also don’t overthink it too much. Find a good balance betweenr reading up patterns and just coding!
Good luck