1
submitted 1 year ago* (last edited 1 year ago) by MxRemy@lemmy.one to c/haxe@programming.dev

Working on a text-based game in HaxeFlixel, and I'm wondering if there's a best practice for dealing with the text itself. There's a lot of it, and it's full of newlines and quotes and such. I imagine putting it in the actual Haxe script is probably not the best way, since you'd have to use a zillion escape characters? So like maybe a Markdown file where you could tag each text block something appropriate, and then parse it from Haxe?

EDIT: I ended up just keeping all the dialogue in a simple .txt file. I wanted to make adding dialogue as accessible as possible for people with limited computer skills, basically. And it actually turns out that Haxe's string parsing will handle alllll the escaping for you, so they can pretty much use any characters they want! Except colon (:). They just have to give the dialogue a title inside colons like :this:, and I have it set up to parse the .txt into a dictionary where the titles are the keys and the dialogue is the corresponding value.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here
this post was submitted on 20 Jul 2023
1 points (100.0% liked)

Haxe

117 readers
2 users here now

Welcome to the (unofficial) Haxe community!

In their own words, "Haxe is an open source high-level strictly-typed programming language with a fast optimizing cross-compiler." Mostly it's been used to create a lot of really cool indie games, like these:

Honestly I'm a pretty novice programmer myself, but I'm moderating this community anyway because it needed one. If you have experience with Haxe and are willing to moderate, please let me know and I'll promote you!

A bunch of game engines are written for Haxe, including:

There's even Stencyl, a gamedev tool built on Haxe that has a GUI and requires little to no coding. Including a block-based coding interface if you're into that sort of thing.

I'll add more resources here as they occur to me or people suggest them!

founded 1 year ago
MODERATORS