Jump to content

Phaser (2.2.2) Glitch (SOLVED) (Kind of my fault)


Ejiswkrosmew
 Share

Recommended Posts

 

Hi. I am encountering an error stating "Uncaught TypeError: Cannot read property 'isDown' of undefined" (referring to !getGameData.right.isDown). I think this is due to the fact that the create function hasn't run yet, but the weird part is that at the end of the code if I uncomment that console.log(), I get the error, but leaving it commented makes it fine. Can I have some help with why this happens? As of now, something is happening (other than this) that I kind of want to fix/add and to properly debug, I want to use console.log like so. Please tell me what is going on here and how I can fix this. 

 

P.S. The reason why there's nothing in the update function is that I don't want the player to be able to cheat by pausing the game (clicking outside of the phaser game). Due to that, I decided to use setIntervals instead of game.time.events. I don't think that the update function should matter that much though.

 

EDIT: Looking back, I think I'll give the line to the code rather than pasting it here: Link

 

EDIT 2: Looks like I was really stupid. Essentially, the error was in the fact that getGameData.ghostPiece wasn't defined. However, there is a 1/7 chance of it working due to the RNG. As soon as I fixed that up, it was fine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...