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
@@ -119,18 +119,18 @@
shootBullet();
};
// Update game logic
// Create a pause button
-var pauseButton = new LK.Button({
+var pauseButton = LK.getAsset('button', {
text: 'Pause',
x: 10,
y: 10,
width: 100,
height: 50,
onClick: function onClick() {
LK.pauseGame();
// Create a resume button in the pause menu
- var resumeButton = new LK.Button({
+ var resumeButton = LK.getAsset('button', {
text: 'Resume',
x: 1024,
y: 1366,
width: 100,