scenery small scene manager thing

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
adekto
Prole
Posts: 35
Joined: Thu Dec 06, 2012 11:42 am

scenery small scene manager thing

Post by adekto »

scenery is a small scene system to swap out your "scenes" like intro logo's, menu's and levels

https://github.com/adekto/scenery

Code: Select all

scenery = {stack={}}
function scenery.load(sceneFile, sceneName)
	if scenery.stack[table.getn(scenery.stack)] ~= sceneFile then
  		scenery.stack[table.getn(scenery.stack)+1] = sceneFile end
  	local sceneryChunk = love.filesystem.load(sceneFile..".lua")
  	sceneryChunk()
  	scenery.scene = sceneName or s
  	scenery.scene.load()
end
function scenery.exit()
	table.remove(scenery.stack,table.getn(scenery.stack))
	scenery.load(scenery.stack[table.getn(scenery.stack)])
end
scenery-example.love
(1.07 KiB) Downloaded 151 times
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: scenery small scene manager thing

Post by zorg »

Not bad, but table.getn is deprecated though, you should use # instead.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
adekto
Prole
Posts: 35
Joined: Thu Dec 06, 2012 11:42 am

Re: scenery small scene manager thing

Post by adekto »

thank you, i made the changes on github.

if anyone got some ideas to add to this, or to know a way to make it more user friendly is much appreciated.
Post Reply

Who is online

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