Random, but does anyone know when the next game jam is?
uhhhh GOOD MORNIGB EVERYOBE JEBDJDNEJRJS
Last ones are diabolical
I guess that includes me
october
halloween i think
I do not endorse these cannibalistic actions, it’s a true shame of what this world has become, I have lost all hope in humanity
It better use the oldest language in its oldest form
Oh, you can treat numbers like Booleans?
Yes. In typescript, anything that’s 0, undefined, NaN, etc is treated as “false” in IF statements. That’s why an undefined sprite will be treated as False in an IF block, which lets you check if it exists!
This should have been brought to my attention ages ago to prevent me from creating about thirty variables to check if something exists.
Oof that’s gotta be annoying! I myself rarely run into this problem while coding… maybe because I rarely use many sprites? I use a lot of “for every sprite of kind…” loops, which avoids this issue entirely, or I use general state variables not solely for keeping track of sprites that also happen to prevent the issue.
The one game that this happens most to uses lots of sprite wich all do different things individually, so for over half a year ive been getting around failed cast on null errors with “Presence” variables wich i only set to true while their related sprite is on screen. This is helpful to know and should help avoid my 500 variables issue from now on.
for an even better check, i’d use @jwunderl’s arcade-sprite-utils which has a block that will tell you if a sprite is undefined/null or destroyed
That is wonderful to know, i will probably get to using it post-haste.