Intro
NOICE so I've decided to do a regular thing where it's cool. This is the introduction of WPP - the Weekend Programming Project. They're little things I'll undertake over the weekends to bolster my programming skills, documentation, and add to my repertoire. Usually, they'll fall into a few categories:
- games
- tools
- widgets
- web features;
I'll probably add more later on down the line. And, for my first trick, I'll start with a game.
Clicktime
It's time to make a game.
So it'll be a game about how fast and how accurately you can click with a mouse/trackpad (or tablet, but it'll be slower). In the game window, little bubbles or objects pop up and you have to click them out of the screen as quickly as possible.
I was thinking about having a really basic HTML structure like this
where the game is played within the game window, and then the results of the game appear in a new window below that. The original window will show where the clicks were.
The programming will involve a good bit of JS. The HTML game window will be a set size, and so a random combination of width and height pixels will be generated. At that location, a DOM element will be placed, and you have to click it to make it disappear. If it pops up and you don't click within a certain amount of milliseconds, it'll remove the element and not increment the counter variable tracking how many clicks, and will also increment a counter that tracks how many weren't clicked.
After the game is played, I'll use chart.js, a nice JS framework to display the tracked data in a beautiful fashion.