« first day (3379 days earlier)      last day (1562 days later) » 
00:00 - 20:0020:00 - 00:00

8:02 PM
Hey im doing enormous array checks to build the maps for my games, and I cant figure out if its the canvas or the array (or just my code) thats causing it to not render the stones OR output any errors: codepen.io/SkylerSpark/pen/gObdjye
using tons of these huge checker boxes for each row im checking every character location and height, detecting if its stone, then drawing a stone block at said location:
 else if (curCharacter >= 326 && curCharacter <= 350) {
    drawStone(curCharacter, 14);
    curCharacter++;
   }
somewhat like the one above
like that one is detecting if its in the 14th row
 
side note that you should be loading in this "map" from another file rather than embedding it in the JS. but I don't know how to do that in Codepen so it is what it is
 
Im not gonna bother with github and codepen referencing rn, ill work on better map sorting later, im just worried why its acting the way it is
its not outputting data to the console or the canvas, and Im really just doing this game from scratch with no tutorial or reference, so im unsure where to head
 
another thing, your if chain can be greatly simplified since you're checking continuous ranges
 
I know how to do physics collision detection via characters in an array, but ive never "taken each character and converted it to a said BLOCK"
 
if (i > 0 && i < 25) {
} else if (i >= 25 && i < 50) {
}
can be simplified to
if (i > 0 && i < 25) {
} else if (i < 50) {
}
 
8:07 PM
oh I guess that makes sense
 
the else tells you that it can't be less than 25 or else it would have triggered an earlier case
yep
 
I always ignore the previous if statement, thats probably why I was detecting for >=
 
yeah it's a common mistake to not consider earlier cases when chaining elses
have you tried adding debug logging to the cases you expect to trigger
 
also, I dont think I need "i > 0" in the if statement since curCharacter is reset every time the map is rendered, and is set to 0, always incremented
well thats the thing, in my clicker games, I can just log calculation operations and see where my variables dont match up
in this project, im merging array maps and canvas, and Im not really sure WHAT to log XD
 
well right now you don't know whether your if conditions are being fulfilled at all
for all you know, you might be falling through the entire chain
so I'd just add lines like
   if (curCharacter <= 25) {
     console.log(25);
    drawStone(curCharacter, 0);
    curCharacter++;
   } else if (curCharacter >= 26 && curCharacter <= 50) {
     console.log(50)
    drawStone(curCharacter, 1);
    curCharacter++;
   }
excuse the bad formatting
 
8:11 PM
oh I see, detect if data even reaches any of the statements
 
yeah I should probably try that
Also I simplified the map system
Large literal string, and its split into an array at load
 
good idea.
 
or perhaps ill try that file thing you mentioned earlier, although Ill set it up later
ill need sanitized github URLs to them anyways
yeah its not logging values, its gotta be something wrong with the if statements
well I found the problem
I wasnt resetting my Current Character variable
 gameArray.forEach(e=>{
  curCharacter = 0;
it shows blocks in the map now
but... all of em are tucked in the top left corner... sigh
yup its not passing correct data to my stone function
sadface
nevermind Im just screwing up more things as I go
 
8:31 PM
@BenFortune Bit confused about something. I disabled websockets in my browser but I am not seeing an XHR requests when I receive a message in chat. How does this occur?
 
@forresthopkinsa Well, I fixed everything by just reworking the detection system to something as simple as a division calculation
so now it just takes 1 argument, x, and divides it by 25
floors it
gets the y
and its working
but its not outputting data to the canvas now .-.
beautiful... it outputs realtime detection data to the console
for each floor too
location and dimension data for every block for the map, BUT IT DOESNT WRITE IT TO THE CANVAS
heck I even reworked it so now I have a universal drawing function for all the elements...
yet it just doesnt draw on the canvas, i want to rip out my hair
 
Sidenote, I think there is an asteroids game easter egg built into chat
 
Cool, im just braindead over my canvas right now
 
hmm how does everyone use cookies with mobx/react?
 
Im really clueless...
 
8:42 PM
It seems a perfect target to have a "store" of cookies, yet I can only find a single library, which hasn't updated.
 
8:57 PM
Ya know what? Screw canvas, im doing my game in html, only leaving a transparent canvas for player movement
 
@TaylorS You need to get unity and webgl going. It's 2020!
 
;-; i know
I just wanna enjoy the webdev age ,-,
I wanna make a platformer
then ill move on to unity
(ill probably still make tons more random JS things because JS is relatively easy and fun)
 
9:54 PM
Hmm I'm now moving often between two branches, with one branch having an (incompatible) newer library over the older branch.
Do I have to go through the hell of updating the node modules folder each time?
 
nodes a pain in the ass
 
@paul23 newer versions of node are quite fast, how long does it really take for npm i to work?
 
@TaylorS "Indeed, it has been said that node.js is the worst form of server framework -- except for all the others that have been tried" - Winston Churchill, slightly paraphrased
2
 
.___.
Slightly paraphrased MY ASS
lol
 
@FĂ©lixGagnon-Grenier Well it's just that it's quite error prone, giving sometimes headaches where I only later discover I'm still accidentally using the old version.
Installing takes typically 10ish seconds
 
10:09 PM
@paul23 ah right
 
10:43 PM
use two folders
 
11:10 PM
^
 
11:30 PM
You mean keep two local project on hard drive?
 
ye
certainly more convenient than having to delete and reinstall all nodemodules every time you switch branches
 
00:00 - 20:0020:00 - 00:00

« first day (3379 days earlier)      last day (1562 days later) »