Introduction
Topics
1. Why play games?
2. Icons that navigate between game pages.
3. Microsoft Edge and Mozilla Firefox with Windows 10 is my current set up.
4. Keyboard may be better for Arcade games than mouse.
5. Easter eggs and Secret levels.
6. A momentary screen freeze is garbage collection, not an error (hopefully).
6.A. A
Glitch is a computer hiccup, not a program error (hopefully).
7. Change speed of Arcade game.
8. Music in games.
9. Local Storage stores your preferences for future use.
10. Games are not playable offline.
1. Time-waster or Brain-refresher
Congress years ago got its knickers in a knot about government bureaucrats wasting time playing Minesweeper and Free Cell on their government computers.
For example, an article by Matt Mossman in the August 4, 1997, Pittsburgh Post-Gazette said that North Carolina, Republican senator Lauch Faircloth claimed a cost of $10 billion per year wasted on computer games by U. S. government bureaucrats. "These computers are for work, not fun, and the taxpayers are footing the bill for fun on the job."
I disagree.
*** My brain needs a nap when I hit a brick wall in working on a computer progam. I need to let the problem percolate for a few minutes before I attack it again.
*** My brain needs a nap when I switch from writing one part of a computer program to writing another part. I need to purge the previous program and load the framework for the new program.
I believe the human brain needs a brief nap every half hour to hour to clear out all the cross currents of the old task and rev up for the next task.
I used to use Minesweeper & Free Cell. Now, I play my own games:
*** Play Drain to 100 points.
*** Play a level of Split.
*** Play a game of Nimble.
2. Navigate

Main Game Page where you can choose a different game to play. (In some games on the game page, you can press M key when game is stopped or paused.)

Go to game.

Game help page. (In some games on the game page, you can press H key when game is stopped or paused.)
A quick way to get to a game is to make it a “favorite” of the browser.
2. A. Using the Help Page
When you are playing a game, you may have a quick question. You click the help button. You go to the help page. You get the answer to your question. You click the game page button. You return to the game. Uh oh! You were halfway through the game. All your work is gone. You are back at the start of the game. No! No!
There is another way. Set up two tabs in your browser.
*** Open the game in your browser as normal. The game is in one tab.
*** Open a second tab by clicking the + to the right of the open tab. Enter the address for my website in the address bar. This time, go to the help page instead of the game page. The help page is now in the second tab.
Now, you have the game page on the left tab, the help page on the right tab.
Click the game page tab to play the game.
If you have a question, (click pause if an arcade game,) then click the help page tab (not the help page button). When you are done reading the help page, click the game page tab (not the game page button). You will return to the game. The game will be as you left it. Resume playing the game where you left off. (Click play if an arcade game.)
3. Internet Gods
When I started writing these games in the days of Windows 98, a desktop computer with Microsoft Windows and Internet Explorer was dominant.
Well, the government hit Microsoft over the head with a monopoly lawsuit and, now, we have desktop, laptop, tablet, smartphone computers. We have Microsoft Internet Explorer/Edge, Mozilla Firefox, Google Chrome, Apple Safari, Opera browsers.
No longer is there one internet god—Microsoft—I can build my programs for. Instead, every company picks and chooses what is acceptable to them. Documentation consists of community websites which are basically the blind leading the blind.
I am one person. I can't do it all. I am upgrading these games to my current setup: Microsoft Windows 10 on a 1366x768 laptop using Microsoft Edge and Mozilla Firefox browsers.
Give the games a try. If they don't work, move on.
(Note that it is perfectly legal and all right to have multiple browsers on your computer. It is even recommended since some websites display better in one browser than another.)
4. Keyboard vs. Mouse in Arcade Game
When I was first writing computer games, I only used the keyboard for actions in an arcade game. As I update the games for Windows 10, I am trying to add using the mouse.
Writing an arcade game for a mouse presents some challenges:
*** With a keyboard, there are lots of keys to assign actions to. With the mouse, there are only one, two or three buttons. I am currently handling that problem by placing pictures around the edge of the game playing field for the mouse to click on. It's not perfect since you have to keep looking where the mouse cursor is and getting it to the right picture.
*** Because some people are right-handed and some left-handed, it is unclear what the left mouse button should do. Should it do a main action (usual for right-handers) or an extra action (usual for left-handers). This leads to labeling the buttons "primary" and "secondary". The main action would be done by the primary mouse button.
*** A similar problem is that the secondary mouse button usually brings up a "context" menu (A menu of appropriate actions to take for whatever the mouse is currently clicking on). It is difficult to wean the mouse away from displaying the context menu. (event.preventDefault() seems to be the magic needed.)
*** I am currently trying to limit the mouse to just using the primary mouse button. This has the added advantage that, if I ever get a touch screen computer, it should be easy to have a finger touch do the same as a mouse click.
Note that I like using the mouse at the lower levels of an arcade game. It's a lot easier to move and click with the mouse than hunt and peck with the keyboard. However, at the higher levels of an arcade game, there may be lots of things going on. The computer may not be able to keep up with all the mouse movements and clicks. You may want to switch to the keyboard then.
Note that, while I use one set of keys on the left side of the keyboard for left-handers and a duplicate set of keys on the right side of the keyboard for right-handers, you are free to use a couple of fingers from the left hand on the left side of the keyboard for one action and a couple of fingers from the right hand on the right side of the keyboard for another action. I find this works better than trying to fling the fingers of one hand around one block of keys.
5. The Return of the Easter Egg
In the 1980's, when a development team would finish a software program, they would add a signature module to the program. It would display their names and some fireworks exploding in the background.
Company policy prohibited including individual names in a program. It was a company program; therefore, only the company name could be displayed.
So, the programmers hid their signature module. You had to go to a particular place in the program and press a particular combination of keys.
Over time, the secret would leak out. One inside programmer would tell an outside programmer who would tell another till everyone would know.
By then, the program would be so widely distributed, the company couldn't recall it and remove the signature module.
In computer jargon, the signature module became known as an Easter egg since it was hidden and, when you found it, it was colorful.
Easter Eggs then extended to movie DVD's. Use your remote at a particular frame of the movie to navigate to a particular point on the screen and click OK. You would be rewarded with, perhaps, a gag reel of flubs and faux pas from the film.
Whole web sites were devoted to listing all works known to have Easter eggs and the keys to unlock them.
With my original games, I felt I ought to do something along those lines. So, I often included a secret level reached by doing something special in a regular level.
When I started updating the games, I thought that Easter eggs had been a fad of the 1990's. I thought they had disappeared with the Tech Wreck. So, I figured to dump the secret levels. Most of mine were poorly written, spur of the moment, throw aways. I figured, if any one was worth saving, I'd convert it to one of the regular levels.
Well, surprise to me, Easter eggs are still around.
I recently bought the Blu ray edition of Hunger Games Catching Fire. It came with free goodies. Six bags of popcorn. A shaker of seasoning for the popcorn.
When I took the disc and goodies up to the counter, the clerk said, "Wait, you get more free goodies."
He reached back and handed over a Catching Fire, Katniss Everdeen movie poster to add to my loot and a woven cloth bag with draw string top and a mocking jay pin emblem on it.
When I got home, I got on the internet and used my Ultra Violet cloud storage account and Target Ticket account to download the movie to my computer.
As a result, I also got the three extra, special features on the Target exclusive edition of the movie.
One of the special features listed for the disc was Bookmark. I thought that meant there would be sections from the book that would be tied to scenes from the movie.
Instead, when I clicked on Bookmark, the disc told me I didn't have any bookmarks selected.
That tipped me off that some how I had to set bookmarks in the movie. I couldn't find any explanation on how to set bookmarks. Over three weeks, I Googled various phrases such as "Catching Fire bookmark".
Bit by bit, I learned that Blu ray discs may contain a computer program apparently written in a version of the Java computer language.
I got enough of a hint that I was able to set a bookmark.
But I couldn't delete it.
I could bring up a dialog that shows options of "bookmark", "delete", "toggle bookmark". The dialog was grayed so that I couldn't do anything with it.
Out of frustration, I pressed various combinations of keys on my remote hoping to get lucky and delete the bookmark.
Suddenly, the screen came alive with a line from the book about "My next stop is the HOB". There followed several scenes of artisans working. It was an early trailer for the Mockingjay movie.
Alas, I didn't know which button had activated the scene. This set me off on a new odyssey of Googling.
I discovered that not only is that scene an Easter egg, but there is an Easter egg on the original, Hunger Games Blu ray disc.
Easter eggs are still around. So, now, I'm planning to keep the secret levels in my games.
They're not really very secret. I explain in a game's help file how to reach them.
(If you're interested in finding the Hunger Games Easter eggs, click here,

, for my explanations.)
6. Momentary Screen Freeze
During the day, you meet new people, enjoy a piece of cake, moan at your sports team's loss. These experiences are first stored in short term memory.
At night, while you are sleeping, a few, strong memories such as the name of a new acquaintance are connected to the appropriate area of long term memory.
In much the same way, computers need to sleep.
Your computer is constantly filling its memory with temporary information needed by pieces of your program.
Every few seconds, the computer has to clean out the data that is finished being used. Otherwise, it would run out of working memory. It conducts a “garbage collection” cycle.
The computer decides on its own when to stop everything and delete no longer needed data.
If you are concentrating on a game and the computer suddenly freezes, all you can do is lean back, draw in a breath and hope that the pause is garbage collection and not an error.
6. A. Glitches Happen
June 27, 2016, I was playing the first level of the Chase game. My piece refused to go into the corral at the center bottom. It would bounce oddly away from the entrance. I thought the game was broken and that I would need to investigate what had happened. For the nonce, I went to another level and played it without any problem and went on to other things.
Later, a thought popped into my mind. The game code was fine. What had happened was that the red lock that guards the entrance to the center bottom corral was there, but it wasn't showing. My piece had kept bumping into the lock as it tried to get into the corral. The red lock was invisible so my piece bounced crazily away.
This shouldn't happen. When the game starts, I preload images including the red lock so they should be ready to go.
This wasn't an internet problem since I was running the game on my home laptop computer.
There was no word description or tiny rectangle with an x in it indicating an image failed to load.
This was a glitch.
If it happens to you, just go to another level or restart the game or try again another day.
7. Heartbeat in Arcade Games
The arcade games have a heartbeat. Each heartbeat, the pieces move.
If the game is moving too fast, you can slow the heartbeat down to up to 999 milliseconds between beats (approximately 1 second)
If you want, you can also make it beat faster down to 1 millisecond. Your computer's heart may not be able to beat that fast. All that will happen if the heartbeat is too fast for the computer is that it will skip several beats until it catches up.
The game must be stopped (not playing or paused) to change the heartbeat. With your mouse, click the number area so it has a blinking cursor. Enter your new value. The number must be a one, two or three digit whole number such as 60, not a fraction.
Click outside the number area with your mouse. The computer will display in the number area the heartbeat it will use. If the computer displays a different value from the one you entered, be sure the game is stopped, not paused or playing.
(Note: In a test on a Windows 7 computer, clicking on an empty area outside the number area locked up the keyboard. Clicking on any element such as the stop button or player piece unlocked the keyboard.)
Local Storage
If the above line says your browser supports Local Storage, then, if you change the heartbeat, it may be stored on your computer so that, when you return to the game days later, the changed heartbeat will be used.
8. Music
Adding music to a game is trivial. Just tell the browser, “Sound.play();” and you're in business.
I looked forward to adding music to my games.
Whoa! Not so fast.
I ran into several problems.
File Format The best format for music files is .mp3. Unfortunately, it is patented. That means I would have to pay the patent holder a fee to make .mp3 files. As I understand it, the patent (has already expired or) will expire in September 2017. Until then, I will use the lower quality .wav format at 11,025 Hz.
Browsers Microsoft Internet Explorer does not (as of January 2016) play .wav files. It does play the fee-charging .mp3 files.
My music will not play in Microsoft Internet Explorer.
Bizarrely, the new browser from Microsoft—Edge— does play .wav files.
Go figure.
Making Music I splurged on a software package to make music. On the outside of the box, it promised:
*** “Simply make what you want. Make your own music.”
*** “Genuine Pro Audio Technology enables you to create professional productions at home.”
*** “You'll have everything you need to let your creativity flow and make your own hit songs.”
Great! Just what I wanted!
Additionally, the outside of the box said the product was special to the electronics retailer. They are always touting their offering me the best buys. I gave the product extra credit.
I opened the box which meant I broke the seal so I can't return it.
I installed it which means I finally could read the manual.
Buried deep inside near the end of the manual where few would venture, I learned that, if I made a song to play on my website, I would have to pay an additional fee.
I checked the internet and found that others were as outraged as I was.
So, that was money down the drain. I am stuck with using an electronic keyboard and a free, bare-bones, open source software program called Audacity.
Sound in the Browser A trivial problem I normally would not mention but that simply adds to my frustration is that the genius(?) programmers that provide the commands to use in the browser:
*** provide sound.play()
*** provide sound.pause()
*** do not provide sound.stop()
40 years ago 8 track players provided a stop button. Not these geniuses. I guess they figured 2 out of 3 was good enough. So, I have to write the code for a stop button myself.
Background Music Professional games may have orchestral music playing in the background of a game.
For the first, oh, 100 times, it is lush and resonant. Eventually, it feels like a buzz saw cutting through my brain.
I don't plan to provide background music for my games.
Sound Effects For years, I played the Microsoft Minesweeper game. In the early days, the sounds were listed in an .ini file. I changed many of them.
For my game Chase, you need to keep your eyes on your piece so you can collect treasures and win the level.
At the same time, you need to keep your eyes on the skulls which are chasing you. If one touches you, you lose the level.
What if your piece is on one side of the playing field and the skulls are on another side? Problem!
You can't split your eyes and have one watch your piece and the other watch the skulls.
Flicking your eyes back and forth can mean your piece will scoot by and miss a treasure while you're glancing at the skulls.
I added some sound effects to the actions of the skulls:
*** kazoo—a skull has teleported.
*** bell—a skull has destroyed a decoy.
*** explosion—a skull has been sent to the grave by a bomb.
Your eyes can stay on your piece. Your ears can keep track of the skulls.
9. Local Storage
Local Storage
"Local Storage" is the new cookie. Where a cookie for Internet Explorer, according to a Microsoft comment, can store at most 20 name, value pairs with a combined 4 KB of data, Local Storage can store 10 MB of name, value pairs. Where the code for a cookie is difficult to write, the code for Local Storage is simple to write.
Local Storage data is stored on your computer forever. This makes it useful to store game preferences. You can start each visit to the game with the same options you chose last time. You don't have to set the options anew each time you visit the game.
Note that there is a different kind of storage called Session Storage. It works the same as Local Storage except it only lasts while your web session is on. Once you end your visit to the internet, the Session Storage data goes away.
If the above box says your browser supports Local Storage, then things like music volume, game heartbeat, high score record, etc. should be stored for use in future games.
Note that Local Storage is boxed in. A name, value pair that is stored is known only to:
*** one website
*** one browser
If you change some preferences in one of the games on my website, only my website can access them. If you go to some other website, it cannot access the Local Storage from my website.
Similarly, if you change some preferences in the game while using Firefox, they will be stored in the Firefox version of Local Storage. If you then go to the game with Microsoft Edge, it won't know about the Firefox Local Storage; it will use the preferences from the last time you used Microsoft Edge (or the defaults).
This actually can be useful. You can set preferences for a fast game using Firefox, then set preferences for a turtle-paced game using Microsoft Edge. When you have a friend over you can demonstrate the game on Microsoft Edge with the slow options. Then, casually close the browser while asking your friend if he'd like to play. If he says yes, open the game in Firefox with the fast options and let him play.
Cookies have a bad reputation because they are used to track and profile you. Some people fight back by refusing to allow cookies on their computer. I was faced recently with a well-known company who denied me entry to their website unless I accepted their cookies. The fight goes on.
I expect Local Storage will face the same battle. Privacy is an antique concept.
For now, I plan to use Local Storage for my games since it saves you having to reenter preferences. However, it's up to you whether you want to allow it. You can still play the game if you don't allow Local Storage. All that will happen is that if you want to change a preference from the default, you'll have to enter your preference each time you visit my website.
10. Play Game Offline
The internet has a technology called App Cache which allows a game to be played when you are not connected to the internet. In essence, I fill out a list of all the files the game needs on a "manifest". Those files are downloaded and stored on your computer. Then you can play the game offline.
There are other ways to download a game such as rummaging in your browser's internet cache.
At the present time with WiFi available seemingly everywhere, I feel most people have ready access to the internet so that my games can be easily played online. So, I don't plan to take the time to write the code or provide the instructions to make them available offline.
_______
update 8/15/17
copyright © 2015-2016 Fred McCarthy. All Rights Reserved.