@Endurion Here is the code: https://editor.p5js.org/LttntLark/sketches/IauCPtvxN
I'm making a 2d game, and am having a problem with one line of code.
It says script error, only because i needed to put all the files into this website. Line 32 of player.js has the broken line grayed out.
A weird environment. Anyhow, the problem is, that d ends up being “NaN”.
keyDown.A and keyDown.D are both undefined.
Try outputing values with console.log( variablename );
That shows even in that environment on the bottom left side.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
@Endurion How do i do that exactly? im sorry, i just started with javascript, and the code is all from a tutorial
Ah, didn't see I can look at all the other files as well. Anyhow, settings this inside player.js works for me:
var d = 0;
if (keyDown.D)
{
d = 1;
}
if ( keyDown.A )
{
d = -1;
}
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
@Endurion Thanks to your help, here is the finished rough-draft of my game:
https://editor.p5js.org/LttntLark/present/IauCPtvxN