Ejiswkrosmew Posted June 21, 2018 Share Posted June 21, 2018 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.