Lua OO Library - bmclass

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Lua OO Library - bmclass

Post 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.
User avatar
slime
Solid Snayke
Posts: 3134
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Lua OO Library - bmclass

Post by slime »

Perhaps a few people are, but generalizing that statement to the whole community is not at all accurate.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: Lua OO Library - bmclass

Post 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 63 times
My English is very poor. I hope you all can understand what i said.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Lua OO Library - bmclass

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Lua OO Library - bmclass

Post 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!
Help us help you: attach a .love.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Lua OO Library - bmclass

Post by Kadoba »

Yep. You were right. I renamed all the files to lowercase and it works.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: Lua OO Library - bmclass

Post 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 218 times
TD002.png
TD002.png (15.15 KiB) Viewed 2457 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Lua OO Library - bmclass

Post 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)
Help us help you: attach a .love.
bmzz
Prole
Posts: 16
Joined: Fri May 06, 2011 9:21 am

Re: Lua OO Library - bmclass

Post 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 212 times
screenshot
TD003.png
TD003.png (19.43 KiB) Viewed 2430 times
thanks for your testing.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Lua OO Library - bmclass

Post 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 {}
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests