Thanks to the tutelage/help of the Awesome Sir @JohnK I got to create the foundation for my memory match game. The only thing missing is now is adding a win/lose animation to end. Here is the PG:
Thereâs a number of ways you could do a win screen at the end of the game. If you want simple text/GUI, you could either do vanilla js/html/css, or you could use the Babylon.js GUI system:
My 0.02 cents would be that since youâre already in Babylon, why not add something with a little bit of fun flare to it. Perhaps celebratory particle system fireworks???
What I had in mind is if a person wins the game within the set time they get something that says âWinnerâ or something fun happens and if not then a try again or similar.
Iâve checked out particles on the âExamplesâ page plenty of times but never though of a way to use themâŚthis will definitely be a fun way to use it!!!
I just added a timer on lines 62-74 via this link:How to set a countdown timer in javascript?. Trying to get the timer to connect as well as add in place of the word completed either the fireworks PG(success) or a simple Try Again with sad face font awesome or sad sprite (failed). How do I get all to function correctly?
Hey @Mekaboo - so the way this timer function is workingâŚwhen the game âstartsâ you need to set a future date, then every second, this interval fires and creates a new âcurrent dateâ element and subtracts that from the future date. If future date - current date is less than zero, then it will log the word completed.
So the current problem is that youâre not setting the future date as highlighted in the article you found: let countDownDate = new Date("Jul 21, 2020 00:00:00").getTime();
A couple of other random suggestions/thoughts about your game to possibly make it a little better.
Consider limiting the alpha radius so the camera canât rotate behind the board. Donât let people cheat hehehe.
Also you might want to consider creating a grid of possible tile placements and then randomly picking one of those positions for each tile. Currently it looks like the tiles always end up in the same place.
I took out the date section becuase I just wanted the time but I guess it wonât function without it. So setting it to all zeros it wonât affect the game much?
As far as the alpha radius I was thinking of that becuase I took a peek on the back(Iâm the owner so I can do thatâ:grin:)
As far as tiles the content changes on the back so I think having moving tiles probably wouldnât be good at this time but who knows where this game will go and maybe can do that in the futuređ