Hey, so I’m having a murder of a time trying to work out how to do a pickup and weapon system.
I want the player to be able to find weapons laying on the floor, and collect them. I’m not sure though, how to tell the player what weapon they’ve collected short of just having a massive table of weapons and all the weapon logic in the player.
In OOP I’d either do it all with inheritance, of have some kind of weapon struct that defined the weapons stats, and a weapon functionality class that took a stat block and used it to create a bullet (which might be another stat block).
What’s the “Defold” way to solve this?
Additionally, I’ve also been having a bit of a mare doing random world generation. I was thinking I could just build a tilemap by setting different images, but I think I can only do that within the size of an existing tilemap.
So next I was thinking I could randomly generate the world as a data representation, and then just draw the visible tiles each frame, but if I have walls or what have you in that representation, then how do I ensure that things don’t walk through them, etc. Is there a better way to do this? Is there a way to generate a tilemap programatically?