wavesinaroom / my_odin_project_photo_tag

0 stars 0 forks source link

Game #5

Closed wavesinaroom closed 1 year ago

wavesinaroom commented 1 year ago

Description

Game loop is primarily handled by <Game/>. Its main functionality is to be a game manager that controls how gameplay items are rendered and some states.

Tests

wavesinaroom commented 1 year ago

It turned out that Supabase had an RLS option I activated when I was creating the database. That caused the whole mess with not being able to fetch data mainly. On the other hand, I blindly beleived that player's selection should be handled with useEffect. Instead of that, I realized later that a function that could be passed as <Image/> prop would do. That function would have two parameters that the player would easily be able to set when clicking on the image. Again, less is more as they say.

wavesinaroom commented 1 year ago

Oh I forgot to mention that I must go back to image because its dialog isn't popping up where it should even though the rendering on click is correct

wavesinaroom commented 1 year ago

It took some time and hard work to hook up the clicking system and fetching items coordinates from the server but it worthed the effort. This issue will remain open until the timer is implemented.

wavesinaroom commented 1 year ago

I was ready to tackle down the game over condition bug I ended up with Friday last week. Turns out, there's not such bug, the condition works perfect but Doll coordinates and Cat coordinates aren't right on the y axis. Aside from that, The dialog that was supposed to be rendered when a player has found Sarah's toys seems to behave the same way the item picker dialog, meaning that it needs a coordinate to pop up. I just want to confirm if in-line style in a component affects same tag elements. I didn't move further but I'm happy to catch bugs easier and easier.

wavesinaroom commented 1 year ago

Cat and Doll y coordinates are right now

wavesinaroom commented 1 year ago

Input isn't working well with game since it is rendered while game fetches data from the server. That's why I'm taking it away from game.js and render it in leadboard.js instead

wavesinaroom commented 1 year ago

Game's working fine at the moment. Should've closed this a while ago