Search found 37 matches

by applebappu
Fri Aug 06, 2021 6:15 am
Forum: General
Topic: how to make individual objects in lua?
Replies: 4
Views: 5614

Re: how to make individual objects in lua?

Speaking as someone who's dabbled in Lua OOP and ultimately mostly given it up except where absolutely necessary, I'd strongly advise against trying to arbitrarily apply any particular programming paradigm to Lua, especially OO. This is because Lua is a very simple language, and the words we use to ...
by applebappu
Thu Aug 05, 2021 7:18 pm
Forum: Support and Development
Topic: Adding trees and rivers to procedural map and voronoi to tiles
Replies: 7
Views: 4387

Re: Adding trees and rivers to procedural map and voronoi to tiles

Gotcha lol. Yeah I do sometimes accidentally get rivers, but there's nothing in the code saying "make rivers" per se.
by applebappu
Wed Aug 04, 2021 7:13 pm
Forum: Support and Development
Topic: Adding trees and rivers to procedural map and voronoi to tiles
Replies: 7
Views: 4387

Re: Adding trees and rivers to procedural map and voronoi to tiles

Not as such right now. There's nothing forcing water tiles to spawn next to each other. Though I think that's simple enough to make happen, with some post processing. Like after you generate the initial noise map, you could iterate back over it smoothing it out with some probabilities. Say, if noise...
by applebappu
Wed Aug 04, 2021 6:41 pm
Forum: Support and Development
Topic: Implementing levels
Replies: 16
Views: 12273

Re: Implementing levels

Ah, neat! So, Lua makes this kind of thing super easy, actually. What you'll want is probably to set up a table in advance, that you'll use to store your maps. Because, those maps, they're just tables too! You can shove tables inside other tables, and keep them there, pull them back out later, etc. ...
by applebappu
Tue Aug 03, 2021 11:02 pm
Forum: Support and Development
Topic: Implementing levels
Replies: 16
Views: 12273

Re: Implementing levels

The type of game im making is basically a more simple game, basically picture a block going through an obstacle course, and if it falls it dies. Simple games are a fantastic place to start! Are you looking to make all the levels yourself? Or write code to do procedural generation? Single-screen, or...
by applebappu
Tue Aug 03, 2021 6:56 pm
Forum: General
Topic: Code preferences
Replies: 9
Views: 8547

Re: Code preferences

How about classes? There are definitely times when it's useful to pair a table with some functions, particularly in game dev. When that situation arises, I try to keep it as flat as possible. I don't bother with encapsulation or any of that OOP nonsense (I solve the problem of shared state by doing...
by applebappu
Tue Aug 03, 2021 6:46 pm
Forum: Support and Development
Topic: Adding trees and rivers to procedural map and voronoi to tiles
Replies: 7
Views: 4387

Re: Adding trees and rivers to procedural map and voronoi to tiles

Sure! I recently implemented a few different "tilesets" for forests, volcanos, and caves.

cave:
forest.png
forest.png (17.94 KiB) Viewed 4196 times
forest:
cave.png
cave.png (12.17 KiB) Viewed 4196 times
volcano:
volcano.png
volcano.png (18.96 KiB) Viewed 4196 times
Edit: Here, go ahead and poke through my source if you like.

https://github.com/applebappu/wizard-tower
by applebappu
Tue Aug 03, 2021 2:41 am
Forum: Support and Development
Topic: [SOLVED] Why is my font not dimming?
Replies: 2
Views: 2252

Re: Why is my font not dimming?

Oh my god, lmao. I knew it would be dumb. Thank you. Setting it to 100/255 for the RGB and 255/255 for the alpha yields:
Screenshot from 2021-08-02 18-42-05.png
Screenshot from 2021-08-02 18-42-05.png (13.29 KiB) Viewed 2235 times
Thank you!
by applebappu
Tue Aug 03, 2021 12:18 am
Forum: General
Topic: Code preferences
Replies: 9
Views: 8547

Re: Code preferences

I pretty much always separate out variable declarations, table items, function declarations, everything gets its own line. It just makes it way way easier to go back and parse later as the project gets larger. One-liners are fun as a challenge but it doesn't make a good workflow for me. As for namin...
by applebappu
Tue Aug 03, 2021 12:06 am
Forum: Support and Development
Topic: Adding trees and rivers to procedural map and voronoi to tiles
Replies: 7
Views: 4387

Re: Adding trees and rivers to procedural map and voronoi to tiles

I had to deal with something similar in my own game, actually. Your implementation may vary, but basically what I did was use the initial output of the noise map to then choose tiles from a table of potential selections, and then tweaked the table and the noise function until I was getting stuff I l...