It gives line numbers like “at undefined:53042:53”
The number ranges from 0 to -5 depending on the length of my code.
here is the code
Have you copied and pasted the code from another editor?
It seems to me that you might have extra non-visible characters either at the line-ends or file-end.
I did get an undefined error of line 2 and when I deleted after the ; the sketch worked.
BTW the game looks promising but I thought the the red dots very quickly became so fast I just gave up trying to touch the red dots.
Thanks that is a convention in the genre.
Make a game too hard to beat and then use upgrades until you can.
I used JShint to clean some stuff up.
So which ; do I have to delete?
When I first tried it I got an error on line 2, I clicked behind the ; e.g.
Pressed the delete key (not the backspace) and it concatenated lines 2 & 3
Then I pressed the enter key to move line 3 back and bingo your game started.
The most likely culprit is the EOL (End-of-line character) because it can vary depending on the code editor / OS.
I have been playing your game - it’s quite addictive once you undrstand the game play. Well done
Thank you so much you are a mensch do you mind saving the change you made?
Just noticed this. The editor will not allow me to make changes to another persons sketch.
Update
I have created a working copy here
No worries
I fixed it by clicking on “tidy code” I suppose that stripped off the hidden characters.
This is a really cool game!
However, the icon for slow drops upgrade does not show.
It just shows ⛛ .
I guess I chose the icon poorly LOL
⛛is the one I picked
I have been playing your game again very addictive - I must get back to my own programming LOL.
I noticed that as the game progressed and I managed to get bigger and slower drops I was trying to get the net very close to the top canvas border.
This disrupted game play in a number of ways
- if the mouse exits the canvas the net becomes ‘stuck’ until the mouse re-enters the canvas
- When trying to get drops in the top left corner it triggers the intro screen.
- The net is only partially visible.
I suggest that you introduce a solid border (borderWeoght
~20 pixels) and reduce the game play area to inside the border. Also rather than use mouseX
and mouseY
to control the net position you might introduce 2 new variables netX
and netY
then constrain these to inside the border like this
mouseMoved(){
// constrain the net position to inside the border
netX = constrain(mouseX, borderWeight, width - borderWeight);
netY = constrain(mouseY, borderWeight, height - borderWeight);
}
I would move the ?
button to bottom-right inside the border because it is not an area you might move the net.
Personally I think these would enhance the game and in particular the border will ‘frame’ the play area focusing the player’s attention to the game area.
Feel free to ignore these suggestions - after all it is your game not mine.
Those are fantastic Ideas. Also the constrain function is something I wish I knew about before I wrote my own lim function. I am glad you are enjoying the game. Are you playing on The Yellow Quadrangle by JakobVirgil or on the directly from p5.js?
I have been playing in the p5.js editor though I have just visited your site and read some of the comments.
Hopefully they were not too rude.
There is a new version
Organic raincoat by a.king.ink -p5.js Web Editor