dthrasher90 Posted May 14, 2017 Share Posted May 14, 2017 Is there an API out there that will create random NPCs built around predetermined specifications? Link to comment Share on other sites More sharing options...
evilwizard Posted May 15, 2017 Share Posted May 15, 2017 Just do something like this this.game.add.sprite(100, 100, this.randCharacter()); randCharacter: function() { return this.game.rnd.pick(['goblin', 'orc', 'skeleton']) } Link to comment Share on other sites More sharing options...
snowbillr Posted May 15, 2017 Share Posted May 15, 2017 dthrasher90, what are you looking for in your random npc? Do you want a random name? Do you want a random sprite? Do you want an npc that will walk around randomly? There are a lot of different factors that define what an "npc" is. What are you trying to do here? Link to comment Share on other sites More sharing options...
dthrasher90 Posted May 15, 2017 Author Share Posted May 15, 2017 Yeah, just name, stats, etc. no need for sprites Link to comment Share on other sites More sharing options...
snowbillr Posted May 15, 2017 Share Posted May 15, 2017 Okay, so you need a name. First name and last name? One word? Two? Special characters? What kind of stats? What does your game need? Health? Number of fingers? Are the values strings? Arrays? Whole numbers? Fractions? All the properties you're looking for are unique to your game, and the only API for that is one that you build. Define the list of all the properties that you need for each NPC, then start looking for ways to come up with those values. Alexalten 1 Link to comment Share on other sites More sharing options...
Recommended Posts