How are your projects developing?
Any help we can provide?
ok i seem to have a basic grasp on it
pretty powerfull toy, I love how you just connect physics directly to the image object and stuff works. no tick or update loops. Feels a lot more intuitave compared to unitys 2D also.
lua is however missing a few things i am used to such as vectors and object orientated stuff (like if i want to make my own enemy class)
i found a vector class online. but i struggled to make it work, so i hardcoded some basic stuff
and it seems that by using lua tables you can replicate object orientated programming but it is not as convenient
I would ask the question about vectors in our forums: https://forums.coronalabs.com. I'm sure some of our developers have solved this. Lua isn't fully object oriented, but you can get close as you have discovered.
Rob
You can find many different solutions to get your object oriented classes going in Lua but as an experienced Corona developer, I would suggest something like this:
local function createEnemy()
local enemy = display.newImageRect(....)
enemy.isAttacking = false
enemy.valueHealth = 100
...
return enemy
end
It's pretty much what you've discovered with the tables but I wanted to include an example here.
I don't have a game yet, but I have some "cool" story. I try to make a game in defold at first time and it goes hard and slow. So, yesterday, when I worked hard on future game, my antivirus decided to close the Defold and delete it from computer. Apparently, the program is tired of my inept suffering )))