Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object clone corrupts JQuery #16

Open
surfskidude opened this issue Apr 30, 2017 · 3 comments
Open

object clone corrupts JQuery #16

surfskidude opened this issue Apr 30, 2017 · 3 comments

Comments

@surfskidude
Copy link

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

@vmeijering
Copy link

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

@popoulos
Copy link

popoulos commented Feb 12, 2021

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

@devtechk
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants