Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: LK.Button is not a constructor' in or related to this line: 'var pauseButton = new LK.Button({' Line Number: 130
User prompt
add pause button with menu
User prompt
Movement with the keyboard still doesnt work
Code edit (1 edits merged)
Please save this source code
User prompt
i want movement bound to the wasd not the mouse
User prompt
the hero movement still does not work
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'addEventListener')' in or related to this line: 'document.addEventListener('keydown', function (event) {' Line Number: 133
User prompt
map hero movement to w for forward a for left s for back d for right
User prompt
Make enemies move towards hero
User prompt
Make hero able to move
Initial prompt
Soulslike
===================================================================
--- original.js
+++ change.js
@@ -126,13 +126,13 @@
LK.on('keydown', function (event) {
switch (event.key) {
case 'w':
// Move hero up
- hero.y += hero.speed;
+ hero.y -= hero.speed;
break;
case 'a':
// Move hero left
- hero.x += hero.speed;
+ hero.x -= hero.speed;
break;
case 's':
// Move hero down
hero.y += hero.speed;