12 hours ago · Tech · 0 comments

Yesterday’s idea for selecting random tiles seems tasty. Let’s try it. Is it a kind of Composite Pattern? Answer: a firm ‘kind of’. I did make two new tiles last night, and found a couple more, so I”ll install those first. Just hold on a moment, OK? Just a couple more to make and there will be no unintentional mud in the dungeon. I’ve taken to renaming the tile files to match their symbolic names, ‘F_NW’ and ‘F_NW.png’ and so on. It’s easy to do and makes editing the TextureFinder’s dictionary easier and less prone to errors. Now the Good Part OK, let’s do the good part. Here’s the idea from yesterday about how to support weighted collections of tiles to be chosen randomly: I have a vague notion of how we might do that. What if instead of just a file name string, the TextureFinder saved a small object containing the string, returning the string via an accessor? Then we could create another small object, containing several file name strings, and some weights, returning one randomly.…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.