Here's how you extend your scripts in order to make different versions of the same script, a concept widely used in OOP or POO.
My Twitter: https://twitter.com/lPandoraBox
3 messages · Page 1 of 1 (latest)
Here's how you extend your scripts in order to make different versions of the same script, a concept widely used in OOP or POO.
My Twitter: https://twitter.com/lPandoraBox
in which situations would someone do this vs extending a class ?
It’s inheritance essentially.
Say you had a script for “living thing”. Maybe living things could include NPCs (which are invincible). They don’t need health. Then you could have a monster inherit that “living things” script then have an HP/mana etc variables. Then you could have player inherit the “monsters” script and have controls etc.