Instead of mentioning 25 in one place and 1/40 in another, we'll declare a FPS variable
Instead of hard-coding 3 pixels per frame, we'll declare a melon_speed variable
We'll re-order a few things, just in the interests of neatness and grouping related items
I've added comments to help make the code self-explanatory
At the end of the game, you can press 'S' to restart the game
The melons fall slightly faster each time you catch one
The game uses the entire browser screen, whatever size it happens to be
There's also a background image, because everything looks better with a background
You can now copy this game to your private work area inside S2JS.
Recall you can use S2JS as a tutor, as a place to create, store and share your own programs,
or split the screen and use our tutorials for reference and copy/paste code fragments while
you work on your own projects.
If you haven't already registered a userid, click the button to do so. Otherwise click the
button to log on and copy this program to your own area.
Once you've done so, you can enhance the game, make changes, make it your own and share it
with your friends simply by emailing them the website address to your program.
Use different images
Make the game last longer
Make the melon fall faster to begin with
Advanced: Make the melon fall on slight random diagonals
Advanced: Lose a point every time you miss a melon