Okay, so I've been figuring how to do a map system in my game for a while now, so; I came up with an idea but I'm not all that sure on how to do it...
So my thought is that as you enter a new area or "stage", a map is randomly selected and therefore loaded. Now how I thought you would do this is by running a random number generator from... lets say 0-150. Then it would load a script with a map under that number. So for example if it outputted 113, it would load map113.lua
How would I do this?
Thanks in advance!!
HELP NEEDED: Random Map Loader
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- NightKawata
- Party member
- Posts: 294
- Joined: Tue Jan 01, 2013 9:18 pm
- Location: Cyberspace, Room 6502
- Contact:
Re: HELP NEEDED: Random Map Loader
If you just want to load a .lua file at random, then try this:
Try me! One size fits all! (Horrible puns I know)
Try me! One size fits all! (Horrible puns I know)
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: HELP NEEDED: Random Map Loader
If you need to execute the script for the map then do everything from NightKawata's example and then call map() sometime after calling love.filesystem.load(), which only loads a script but leaves you to execute it on your own.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], Semrush [Bot] and 8 guests