SimpleClass Love Engine

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
TylertheDesigner
Citizen
Posts: 80
Joined: Sat Apr 10, 2010 2:27 am

SimpleClass Love Engine

Post by TylertheDesigner »

Hey guys! I have been using the same basic engine framework in LOVE for the past few months for game jams, prototypes, and other projects. I don't know why I waited this long, but I thought it would only be proper if I released it into the wild, and allow all the wonderful LOVE experts here to mercilessly pick it apart.
My goal was to make something that is readable, barebone, and feature-filled. I would like to think I achieved at least a portion of my goal, but would like to get some feedback from you guys!

(As a temporary placeholder, I used the Space Love image. If this is a problem, I can change it.)
Attachments
Engine.zip
Unzip to see Engine code
(230 KiB) Downloaded 129 times
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: SimpleClass Love Engine

Post by tentus »

Cool idea, but you've got some bugs to work out. This will sound a little harsh, but I'm just trying to be factual and honest.

First, you have to require Controller.lua before you can Controller:new() on line 10 of ControlSelect.lua.
Second, Controller need to have a self.name before you can use Joystick[n].name on line 11 of ControlSelect.lua.
Third, you need to include the PO2 fix, otherwise the background is just white nothingness to people with older/weaker video cards.
Fourth (and this is more of an opinion than anything else), you should always use good indentation, even if you don't think it's strictly necessary. I know that your main is pretty staightforward, but you should still indent the code inside of functions. Some of the other indentation seems right-up deceptive to me.
Fifth (again more of an opinion), be consistent with file capitalization. Since main and conf are lowercase, I would recommend making everything lowercase. That's mostly just my OCD side talking though.

If you want I can post a .love with my corrections in it.
Kurosuke needs beta testers
User avatar
TylertheDesigner
Citizen
Posts: 80
Joined: Sat Apr 10, 2010 2:27 am

Re: SimpleClass Love Engine

Post by TylertheDesigner »

Thanks for your feedback! I really appreciate it. I would love to see your changes, if your willing to fix it

I've been adding to this engine after every game jam/prototype, and never intended it to see the outside of my hard drive. However, I have been helping others with code recently, and realized it would be helpful if I could make this engine a little more readable.

As for the Controller issue... it was something I knew about, but completely forgot to set it up before uploading. Thanks for catching it.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: SimpleClass Love Engine

Post by tentus »

Easy mistakes, they're always what get me. Never the hard stuff- no, it's always a single comma out of place somewhere or a variable that I forgot could be niled already.

The .love attached has several of the issues I mentioned fixed, hope you can put them to good use! I have found that being public about my code forces me to code cleaner (mostly out of shame), which helps my projects in the long run.

One last note: a while ago, we had a decent little utilities thread going, you may want to post your month code in there, breathe some life into it. You may even find something in there you want to use.
Attachments
simpleengine.love
(229.81 KiB) Downloaded 124 times
Kurosuke needs beta testers
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests