HOLY WAS THIS A STRUGGLE !!
In this session I implemented adding and removing numbers for a slider in the future (hopefully tomorrow). THIS WAS A PAIN. Especially the camera handling. The very very basic adding and removing function was quite easy, since its only adding numbers or splicing numbers from the array (stack overflow my goat). The camera thing was quite hard though. When I add enough numbers it could make the pillars taller than the viewheight, making them sticking “off screen”. The fix was zooming out. But the fix on stack overflow needed to let it be a JSX element, which somehow didnt work. Finding the fix was one problem. The other problem is, that after finding the fix, it still didnt work and the camera “fell” down. After a long debugging session with various console.logs, I finally found the problem and it was one of the stupid ones. I used z, where it should have been y, thats dumb, but eyy, here we go. There were also a few other bugs, like having an infinite while loop when only having one pillar and shuffling. This was fixed by making the minimum number 2. The other bug was, weird camera behaviors happen, when reducing the number while its shuffled. Fixing it with an instant sort before reducing the number of pillars was my approach. Ya, that was about it. I am done for today.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.