Zoetrope, a starter kit for LOVE

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Zoetrope, a starter kit for LOVE

Post by josefnpat »

It's Fancy to see I'm `internet famous`. I always knew I'd be famous for my

Code: Select all

cowsay -f stegosaurus
.

I'm glad to finally see this out in the "open"!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot »

Here's version 1.0.1, which should solve the arrow key bug along with a couple extra ones I noticed while testing on a Mac tonight. Updated demo is here, too!
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Zoetrope, a starter kit for LOVE

Post by coffee »

klembot wrote:Here's version 1.0.1, which should solve the arrow key bug along with a couple extra ones I noticed while testing on a Mac tonight. Updated demo is here, too!
Thanks, arrow keys no longer failing. I also have the tilde problem. I have it in keyboard but pressing it does nothing. Tried to find it elsewhere but I haven't Nixola luck. Even that configurable another key choice for the demo could be more safe.
opticq
Prole
Posts: 1
Joined: Wed Jun 27, 2012 12:25 am

Re: Zoetrope, a starter kit for LOVE

Post by opticq »

Could you post a snippet that will successfully show a static sprite on screen? For some reason, just a static sprite isn't working for me but the tiles and animated sprites are.
User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot »

See the first source code example on this page. Guessing without any information, you haven't set one of the needed properties. The bare minimum properties you need for a fill are: x, y, width, height, and either a fill or border. I should add some checks for this in strict mode...
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: Zoetrope, a starter kit for LOVE

Post by Kingdaro »

Isn't there a way to use "__index" so that you don't have to put "self" as an argument in almost every function?

Also, when a fill is missing a property of acceleration, it should just default to 0.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: Zoetrope, a starter kit for LOVE

Post by Xgoff »

Kingdaro wrote:Isn't there a way to use "__index" so that you don't have to put "self" as an argument in almost every function?

Code: Select all

local methods = { }
function methods:foo ()
    return self.bar
end

o = setmetatable({ bar = "wat" }, { __index = methods })
however, that definition syntax isn't available inside table constructors so you have to use an explicit self inside those
User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot »

Wanted to let you know I just put out version 1.1, which fixes a lot of annoyances (e.g. you no longer need to specify a x, y, and rotation velocity if you just want one) and also adds much more efficient collision detection. I went with a grid based method similar to bump.lua in favor of quadtrees. btw, if you make something with Zoetrope, please let me know! I am happy to link to it from the project page.

I like the idea of getting rid of self in method definitions a lot, but I also really want people to be able to specify methods in an object right as they extend a class. e.g.

Code: Select all

myObject = Sprite:extend{ bounce = function (self) print('bounce!') end }
User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot »

Resuscitating this thread to let everybody know I've posted version 1.2, which brings:
  • Pixel effects per group, e.g. apply a pixel effect to a specific layer of sprites, or the entire screen
  • A new Subview class to handle temporary views like pause overlays and inventory screens
  • Views have a panTo() method that scrolls the view so that a certain point is centered onscreen
  • You no longer need to write a love.load() function; you only have to create the.app in main.lua and Zoetrope sets it running for you
  • Some debugging niceties, e.g. you can write =2 + 2 instead of print(2 + 2), and objects now print their useful properties instead of just Table <xxxxx>
Compost
Prole
Posts: 9
Joined: Mon Oct 08, 2012 6:10 pm

Re: Zoetrope, a starter kit for LOVE

Post by Compost »

Thanks for putting this together. I'm just learning LOVE and Lua, and finding this quite helpful to get things up and running quickly. It's appreciated.
(e.g. you no longer need to specify a x, y, and rotation velocity if you just want one
This is true for "drag", but for "acceleration", I get errors if I don't include all three.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest