wizguin / yukon

MIT License
75 stars 35 forks source link

Jokes support #6

Closed hangardonelli closed 2 weeks ago

hangardonelli commented 2 years ago

Jokes support is added with crumb files.

The media also needs to be modified. in crumbs.json, add jokes with this format:

"jokes":[{"id": 1, "joke": "Whats a good joke?", "answer": "this one!"}, {"id": 2, "joke": "This is another amazing", "answer": "Joke :D"}]
sky-is-winning commented 2 years ago

What's the point of sleep when you could just use setTimeout? Also, wouldn't sleep not work in the production version - utils aren't built.

wizguin commented 2 years ago

Thanks for the PR, it would be better to generate a joke ID and then send it through send_joke, also instead of using async/setTimeout you can use Phaser timers: scene.time.delayedCall(delay, callback, args, scope)