best way to require and make instances
Posted: Wed Aug 07, 2024 9:42 am
i have here 3 examples how i did that.
now im not sure what is the best way to make this what are the conventions ?
https://pastebin.com/LZdcV1V6
-in the main.lua
using the new keyword directly after the require feels like the best(but could not work if i do instances in instances or ?)
-in the scenemanager
i make this in load and feels somewhat clunky
-in the playscene
i make it in the constructor and feels somewhat okay or good
how you do that ?
best regards
Lovingsoul1337
now im not sure what is the best way to make this what are the conventions ?
https://pastebin.com/LZdcV1V6
-in the main.lua
using the new keyword directly after the require feels like the best(but could not work if i do instances in instances or ?)
-in the scenemanager
i make this in load and feels somewhat clunky
-in the playscene
i make it in the constructor and feels somewhat okay or good
how you do that ?
best regards
Lovingsoul1337