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

game crash status #2

Closed
waynefu opened this issue Oct 21, 2014 · 4 comments
Closed

game crash status #2

waynefu opened this issue Oct 21, 2014 · 4 comments

Comments

@waynefu
Copy link

waynefu commented Oct 21, 2014

when attempting to go through the hole on right side, the game crashed

@SheaStevenson
Copy link

I've managed to reproduce it. When travelling right towards the hole on the right side, hold the right arrow key. The game will freeze up when Pacman reaches the hole.

I'm guessing it's an array overrun or something.

@SheaStevenson
Copy link

I've got a quick fix. In the file pacman-canvas.js on line 873...

Change this:
var nextTile = game.map.posY[y].posX[x].type;

To this:
var nextTile = game.map.posY[y].posX[x%18].type;

@BeemoLin
Copy link

BeemoLin commented Nov 7, 2014

var nextTile = null;
if(x<18)
{
nextTile = game.map.posY[y].posX[x].type;
}

@platzhersh
Copy link
Owner

Actually the problem were misplaced brackets on line 867 and 869. Thx for pointing this out to me!

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