Organizing a Collection of Mini Games?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
dizzykiwi3
Citizen
Posts: 58
Joined: Tue Jan 14, 2014 2:03 am

Organizing a Collection of Mini Games?

Post by dizzykiwi3 »

Hey all!

So I'm working on a game with a group of people that would essentially be a compilation of mini games, a la wariorware, mario party, etc. We've been working on our mini games separately and I'm starting to piece them together.

The obvious issues is of course that there are now about 5 different games with 5 different main files and 5 different sets of love.load, love.update, and love.draw, a slew of paths to images that are now incorrect, and a dozen variables that mean three dozen different things for different games.

I was wondering if anyone had any experience with organizing dependencies like this, or knew of any trick in LÖVE that could help me out with merging these separate games, possibly local name spaces? Even if its a way or design pattern to design future mini games, that would be stellar.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Organizing a Collection of Mini Games?

Post by Nixola »

I'd use [manual]setfenv[/manual] for that. Maybe you could also overwrite the LÖVE loading functions in the safe environments, so you could have a folder for each minigame.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

Re: Organizing a Collection of Mini Games?

Post by Beelz »

What about just having everyone design their games similarly (such as a state), then either use a state library to link them, or write a system.

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Organizing a Collection of Mini Games?

Post by Inny »

If your target platform is win/mac/linux, you could just have everyone send you their .love files and package each individually. If you use something like the [nullsoft installer](https://en.wikipedia.org/wiki/Nullsoft_ ... all_System), then pop out an icon for each game.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Organizing a Collection of Mini Games?

Post by bobbyjones »

The love example loader has a system me and s-ol came up with that should be helpful. I haven't looked at it in awhile but if I remember correctly it would help with your issue.

Edit: This is the branch you would want to look at. If you look in the examples folder you would see that it contains separate love programs. You should be able to make it work for your purposes. https://github.com/love2d-community/LOV ... e/concepts
Post Reply

Who is online

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