Skip to content

Phaser3 framework javascript: current anims index

In phaser 3 framework, what syntax do I use to check the current frame index? I want to make a hit area appear only when the player’s sprite sheet reaches a certain index(the index displaying the motion of ‘attack’). I want to accomplish this through detecting its current frame index. How ca…

Unable to set up the new Faker library

I am trying to set up the new @faker-js/faker library. So far, I did this: Added faker.d.ts at the top level. So the tree is like this: faker.d.ts contents is this: I am trying to use the mock like this: But am keep getting an error, saying Cannot find module ‘faker’ or its corresponding type decl…

javascript button on clock

Now I have issue that only first clicked button works when pressing others post buttons after first clicked button, it just disappears and not loading comments, Adding snipped to clarify issue. It’s first time using this feature. Sorry for issues, may you can help me with that. I’m using django as…

Difference between this.variable and this._variable in JavaScript?

I’m learning the Codecademy Advanced JavaScript course, I’m learning about classes. In their code, I feel this.variable and this._variable have no different but they require to write this.variable even though 2 options return the same output. Can you please explain the differences if you understan…

Tile drawing is not displaying

I’m working on this code where if you put in certain characters for the map array, the canvas will display the image corresponding to that character. I have an array for all the ground blocks, at the top. Here’s my code so far: However, nothing seems to be drawing to the screen. I believe this mig…