Page 2 of 2

Re: Lua OO Library - bmclass

Posted: Sat May 28, 2011 8:50 pm
by BlackBulletIV
Ensayia wrote:It's not necessarily a bad thing at all, it's just that this community is far more interested in reinventing the wheel than making any actual games with this game framework.
Yeah, you may be right there.

Re: Lua OO Library - bmclass

Posted: Sat May 28, 2011 8:57 pm
by slime
Perhaps a few people are, but generalizing that statement to the whole community is not at all accurate.

Re: Lua OO Library - bmclass

Posted: Sun May 29, 2011 6:32 am
by bmzz
Ensayia wrote:
BlackBulletIV wrote:
Ensayia wrote:Oh look, another OO library.
Is that a bad thing? It's all good messing around with Lua.
It's not necessarily a bad thing at all, it's just that this community is far more interested in reinventing the wheel than making any actual games with this game framework.

I've already gotten my karma dinged for pointing out the obvious, so I'll drop the issue now.
I very agree with you. I should make a game with LOVE and bmclass, and I am doing it now.
I'm trying to do TD game with them. And I will keep going to finish it.

It is not yet complete, just for demo.
TD001.love
(10.89 KiB) Downloaded 68 times
My English is very poor. I hope you all can understand what i said.

Re: Lua OO Library - bmclass

Posted: Sun May 29, 2011 5:15 pm
by Kadoba
I get "Error: main.lua:5: module 'component.tower' not found" when I try and run your demo. Its looking for a module in my Love directory rather than in the .love file.

Re: Lua OO Library - bmclass

Posted: Sun May 29, 2011 5:59 pm
by Robin
Kadoba wrote:I get "Error: main.lua:5: module 'component.tower' not found" when I try and run your demo. Its looking for a module in my Love directory rather than in the .love file.
No. It tries to load component/tower.lua, but it only has component/Tower.lua. Case sensitivity bites yet another Windows user!

Re: Lua OO Library - bmclass

Posted: Mon May 30, 2011 5:25 am
by Kadoba
Yep. You were right. I renamed all the files to lowercase and it works.

Re: Lua OO Library - bmclass

Posted: Tue May 31, 2011 4:19 pm
by bmzz
Kadoba wrote:Yep. You were right. I renamed all the files to lowercase and it works.
I'm sorry for that, I fixed at TD002.love.

now, we have enemys and we can build towers
TD002.love
(13.79 KiB) Downloaded 225 times
TD002.png
TD002.png (15.15 KiB) Viewed 2642 times

Re: Lua OO Library - bmclass

Posted: Tue May 31, 2011 5:07 pm
by Robin
Nice, works well. The only thing that annoyed me was that you had to select the tower every time you wanted to place one. Since you'll be generally be placing a lot of those while playing, I suggest the following "fix": comment out line 34 in main.lua. ;)

I also made the enemies a bit more varied by changing line 30 in component/Enemy.lua to:

Code: Select all

self.life = math.random() < .01 and 10000 or math.random() < .8 and 200 or math.random(200, 1000)

Re: Lua OO Library - bmclass

Posted: Sat Jun 04, 2011 10:24 am
by bmzz
I implement the money and "waves" at this version, 3 waves.
but it nothing happen when castle life = 0 or after 3 waves...=p

try it
TD003.love
(16.92 KiB) Downloaded 220 times
screenshot
TD003.png
TD003.png (19.43 KiB) Viewed 2615 times
thanks for your testing.

Re: Lua OO Library - bmclass

Posted: Sat Jun 04, 2011 2:35 pm
by vrld
Two comments on the library:
  1. Please don't use loadstring to set global variables. It's slow as hell and might not work properly with environments. Use _G. See also Chapter 14.1 of the PIL.
  2. The syntax to instanciate a class is really akward:

    Code: Select all

    Dog("myDog", {name = "Snoopy"}) -- why is that better than myDog = Dog { name = "Snoopy" }?
    And it always creates a global object. Most of the time I don't want the object to be global, but be saved in a (local) table:

    Code: Select all

    player.weapon = Shotgun {}