Help with errors within PG code

Happy Sunday!!

I just made this PG with the components I want for my game(rotation, shuffle, animation, etc). I took some components from a Git repo that mirrors somewhat the final result I would like:

Issue is adding the parts from the repo caused the scene not to load as you can see. If possible get some help on how to correct the code.

I added the front/back uv from here to my PG:Apply Different Material to Front and Back - Babylon.js Documentation . For this part how do I place a separate image for both sides instead of using using a url like in the example? Thank ya!!!

:blue_heart: :purple_heart:,

It doesn’t look like you copied complete chunks of code. Loops nd functions just seem to end without being complete. Check the following lines with the original code and try to see what parts are missing. Each opening bracket { needs a matching closing bracket }.

Seems broke at lines. 452, 514, 705, 767

1 Like

Hello :slightly_smiling_face:

Here is a new PG with the complete code added from the repo…the first one I took out code because I did think I needed some of it:

The repo goes with this: How to Build a Memory Matching Game in JavaScript ―

Im trying to take code from this and blend it with my code within BJS but having a difficult time doing so. Try playing with stuff and when loading to view I get a blank screen :confused:

If you look at he scroll bar area between the editor and the scene you should see a red dot this indicates a syntax error in your code. Scroll down until the bar is over the red dot, the error is in this area. In the code (line 211) you will see a } with a red line under it. Place the pointer over the red line an you get some indication of the probable error. In this case it is probably too few or too many curly brackets.

Sorry to say this again but you really need to learn Javascript, even putting together modules of code from here and there will be difficult without more than a very basic understanding. Suggest JavaScript building blocks - Learn web development | MDN though this site covers everything from beginning to the full API.


Thank ya for the advice…will make changes in the PG and look into the link…sorry if being a pest…I may be making a bigger deal out of something that is plain and simple😊

@Mekaboo seeing how persistent you are I will go back to your original problem and try to talk you through a solution step by step.

I will give you a series of tasks/questions , when you have dealt with one task/ question I will go on to the next.

1 Like

Actually the only task is getting the shuffle array and click animation going on. I want flip buttons the way cards are flipped and have 2 buttons match.