pacman icon indicating copy to clipboard operation
pacman copied to clipboard

object clone corrupts JQuery

Open surfskidude opened this issue 7 years ago • 3 comments

The clone function at the end of pacman.js seems to corrupt JQuery, in particular the $.getXXX functions.

I removed the code and replaced: map = Pacman.MAP.clone(); with map = Pacman.MAP;

The code seems to work with this change

surfskidude avatar Apr 30 '17 00:04 surfskidude

It does work at first. Until you complete level 1. The biscuits dont reset because you don't clone the map anymore but use the current instance of the map

vmeijering avatar Nov 12 '19 15:11 vmeijering

just replace map = Pacman.MAP.clone(); with map = JSON.parse(JSON.stringify(Pacman.MAP)); and remove the Object.prototype.clone function

popoulos avatar Feb 12 '21 17:02 popoulos

Hello, it solves a lot of problem also if you want to import it in angular component. Thank you!

devtechk avatar Jun 14 '22 13:06 devtechk