Jason T

Deep passionate guy that loves new experience and journey!

Completed InstantPrize. Using older version of livewire restricting me to some goodies in 2.0

Complete question management!

The only thing worth mentioning in the process today is refactoring of the question modal.

There are a few types of questions.
Just a question statement, MCQ, Fill in the blank...

In order to ensure the question format can be styled separately, using polymorphism, I've extracted out various question layout to different files.

example: partials/mcq, partials/just-questions

This way, if the question is in MCQ format, it will load the mcq layout.

I'm 80% done! Almost ready for a test drive!

Include choose of genre, choosing of bridge, next gold price to build bridge and much more!

Though not really a challenge, but it's something worth thinking. In this game, there are lots of modal to show to user one after another.

The method I've employed is to use a boolean variable for each of the modal.

Show if it's true.

Once done showing, set variable to false and set another variable to true.

This approach doesn't seems to be the best way. But right now it works pretty well.

With the modal replicated so many times, it's time to think about how to abstract out the modal code and be reuse throughout.

Tomorrow, I will finally be getting started at managing questions and genre.

Modal to choose Team

Today I've created all the necessary models for a dynamic team creation. Ideally, I would prefer to create another controller page where respective player can answer questions/build bridge directly from their mobile phone. But just in case I dont have enough time to implement that, I decided to ensure all features are accessible from the main game screen itself too.

The biggest challenge faced today is, how to play an audio when a user successfully answer a question and a bridge need to be built.
It turn out to be easier then I thought.

Simply register a listener event in javascript
Then from Livewire, simply dispatchBrowserEvents to call the event in JS.

JS then plays the audio. It works so well that I'm so amazed!

I might not have a need for AlpineJS after all. Will see how. Next big component to code will be the questions!

looking forward to it!
Jason Leow

Love the long form learnings! :))

0 Likes