Hi all,
I'm new to Lua and LÖVE2d, and I want to make a game over this summer! Specifically, I want to make a strategy rpg, and was wondering if y'all have any ideas about how I could go about being able to generate cursor/play area through a text file.
ie/ if I were to have the below "x"s it would generate a 3x3 field (specifically it would be centred)
xxx
xxx
xxx
Possibly even having more complex files like:
xxx xx
xxx xxx
xxxxxxx
(where there can be tiles that don't contain information [whitespace] and other kinds of characters that generate tiles with different properties and etc.)
If you're having trouble picturing what I'm saying I've attached a link below (even though it's not great [it's the best I could find ]) I followed a tutorial (Gridlocked LÖVE2d Tutorial) and I have that working, but I'm having trouble coming up with a way I could get what I wanted. I like how that Gridlocked Tutorial works though, essentially what it covers as being the player, I'd like to rework into being a cursor.
Any and all suggestions, tutorials or whatever are welcome
Aforementioned Fire Emblem Gif
Generating Game Data from .txt files
Re: Generating Game Data from .txt files
There are ways to do what you describe. But you'd be better off just using a tile map editor like tiled. Tiled can export to .lua files so it's not hard to load them into your game. Plus there's a library called "sti" that can handle it for you.
Re: Generating Game Data from .txt files
Sure, I use text files too.
It's very easy to parse text using pattern matching.
Alternatively you can use string.char/string.byte as described in my tutorial:
https://2dengine.com/?p=isometric
Note that it can get out of hand if you have more than 50-60 different tiles,
as you'll be wondering "hmm, what does tile '}' represent again?"
It's very easy to parse text using pattern matching.
Alternatively you can use string.char/string.byte as described in my tutorial:
https://2dengine.com/?p=isometric
Note that it can get out of hand if you have more than 50-60 different tiles,
as you'll be wondering "hmm, what does tile '}' represent again?"
Re: Generating Game Data from .txt files
Both 2dengine and TIled look pretty cool, I'll check these out, thanks
Who is online
Users browsing this forum: Google [Bot] and 3 guests