You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to design how OOP will work in Lua and Godot. Classes will be implemented with tables and should be as close as possible to the Godot API used by other languages.
Following below is an excerpt for some of the the designs I have so far.
1. Explicitly imports the class Lua module and the node class to be extended and defines new classes through the class's 'extends' method
Although more verbose it gives a classic oop look and feel
localclass=require'lua.class' -- Import the system class librarylocalSprite=require'godot.Sprite' -- Make sure to import the base classlocalMain=class.extends(Sprite) -- Creates the user subclassfunctionMain:ready()
endfunctionMain:process(delta)
endreturnMain
2. Explicitly imports only the node class to be extended and defines new classes through the implicity available 'extends' method
This is more streamlined and concise and gives a mixed oop look and feel
localSprite=require'godot.Sprite' -- Make sure to import the base classlocalMain=extends(Sprite) -- Creates the user subclassfunctionMain:ready()
endfunctionMain:process(delta)
endreturnMain
Please share your thoughts on this two ideas or show us a new idea that you come up about this topic.
-- Perbone
The text was updated successfully, but these errors were encountered:
The idea is to design how OOP will work in Lua and Godot. Classes will be implemented with tables and should be as close as possible to the Godot API used by other languages.
Following below is an excerpt for some of the the designs I have so far.
1. Explicitly imports the class Lua module and the node class to be extended and defines new classes through the class's 'extends' method
Although more verbose it gives a classic oop look and feel
2. Explicitly imports only the node class to be extended and defines new classes through the implicity available 'extends' method
This is more streamlined and concise and gives a mixed oop look and feel
Please share your thoughts on this two ideas or show us a new idea that you come up about this topic.
-- Perbone
The text was updated successfully, but these errors were encountered: