Object Oriented Programming is basically programming that is oriented around the specific GameObjects.
An example is in Halo, with the Warthog vehicle, the chassis has a script that tells the wheels what the top speed is and how fast they need to spin, but the wheels has its own code as well.
Classes can ;pass on their structures to their children for those children to make use of.
"public class Person : Monobehaviour" basically means Person inherits from Monobehaviour.
If another script inherits from the Person script that has access to Monobehaviour (public class Matt : Person), that script also inherits Monobehaviour.
If Person script is public, any other script can access it. If Person script is private, only this class can access it and nothing else.
There's public and private modifiers for a script, but there's also protected, which allows its children to inherit from it but nothing else.
Static methods are accessible to everything in the project. An example for this use would be a Game Manager, Input System, Event Manager, etc. Avoid using this unless necessary. One thing this shouldn't be used for, for example, is a character's jumping ability that accesses a script for the jump height—if the jump height value is set to static and the value of it is increased when the player gets a powerup, and then the player dies, the static value will remain what it was in the last version of it.
The powerups and enemies in Super Mario Bros. are essentially the same thing in terms of functions, that being items, but the difference is the enemies hurt the player whereas items give a buff.
See potential microgame structure on the right.
Standard method cannot be overloaded. It's good for anything that does not need to change in a child class. An example is car wheel rotation based on a given speed.
Virtual function may be overloaded. It's good for things that may need to change in a child class, but not always. An example is character attacks being physical or magical.
Abstract function must be overloaded. It's good for things that always need to be defined in a child class. An example is triggering a success state in a microgame.
Overloading a method means overwriting it.
Plants vs Zombies: Garden Warfare 2 (2016)
by PopCap Games
XXXX
Image: PvZ: GW2 cover art, from Romero, I. (2016) [1]
Image: Pavlov Shack Beta cover art, from Melnick, K. (2021) [2]
Pavlov Shack Beta (2021)
by Vankrupt Games
XXXX
Wwise for better audio: https://www.audiokinetic.com/en/products/wwise/
SpeedTree for generating tree models: https://store.speedtree.com/
[1] Romero, I. (2016). PvZ: Garden Warfare 2- Tips and Tricks for Beginners [Image]. Twinfinite. https://twinfinite.net/wp-content/uploads/2016/01/plantsvszombiesgw2_keyart.jpg
[2] Melnick, K. (2021). ‘Pavlov Shack’ Launches On App Lab, Enjoys Large Spike In Players [Image]. VRScout. https://i0.wp.com/l3apq3bncl82o596k2d1ydn1-wpengine.netdna-ssl.com/wp-content/uploads/2021/04/PavlovShackBeta.png