Mac games
A Time Wasters Compendium

Why this app?

I've never been one for playing games on computers. Back in the day, games were very simple and involved a little bit of thought combined with a little bit of luck. The rules were clear and the objective obvious. Sadly, back then, I was more interested in programming than in playing games.

Fast forward several years and games have moved on significantly, with high resolution graphics, complex story lines and dedicated graphics and sound processors. Unfortunately, for me at least, they have become over complex, requiring many dedicated hours to master. More hours than I am prepared to commit (Though I did manage to complete a couple of platform games on the PS/4).

And so, I find myself hankering for simpler times. Simple games that I can play when I have a spare few minutes and games that I can complete in minutes (with a sense of achievement) rather than hours or days.

Welcome to A Time Wasters Compendium for the Mac.

Key Learning Points

What did I want to achieve?

This is an app well out of my comfort zone. As I may have mentioned, I'm not a gamer, so the prospect of writing games is not something that comes easy. The plan, if I can call it that, is to create an application which can be easily extended to plug in games. The games need to be simple and quick to play.

The aims are simple;

  • A Mac specific app.
  • An engaging home page.
  • Simple games self contained in frameworks.
  • Just for the fun of it, a home page without a title bar.

Acknowledgements

Paul Hudson Hacking with Swift+ live streams .
Sound files ZapSplat.com .
Start page image files pixabay.com .

What it looks like

And the end result is...

The home screen received a fair amount of attention. I may have gone too far, but that's the fun of coding.

Email filtering on the Mac

The opening window has been designed to be based around the background image. I have removed the title bar and the close/max/min icons. For my usage, they serve no purpose. Without the title bar, the window cannot be moved and that is unacceptable. So, I have set the window up to allow it to be moved by dragging the background.

For each game, there is a button. To give the game a little movement, the buttons fade on screen one at a time. When you hover the mouse over a button, the clock face changes to an info icon that can be clicked to display game information.

Email filtering on the Mac

Clicking a button will open the selected game.

Minesweeper

Minesweeper is a classic game from the dim and distant past. The aim of the game is to identify all of the mines without clicking on one and setting it off.

Mine sweeper game

Minesweeper rules are very simple. The board is divided into cells, with mines randomly distributed. To win, you need to open all the cells. The number on a cell shows the number of mines adjacent to it. Using this information, you can determine cells that are safe, and cells that contain mines. Cells suspected of being mines can be marked with a flag.

To win a game of Minesweeper, all non-mine cells must be opened without opening a mine. There is no score, but there is a timer recording the time taken to finish the game. Difficulty can be increased by adding mines or starting with a larger grid. You can do this via the settings panel. Beginner level is usually on an 8x8 or 9x9 board containing 10 mines, Intermediate is usually on a 16x16 board with 40 mines and expert is usually on a 22x22 board with 99 mines; however, you are free to customise board size and mine count.

The original version of this game was produced by Paul Hudson in his Hacking with Swift+ live streams . I've extended the game to include;

  • Variable game play levels.
  • Sound feedback with an irritating ticking sound to add to the tension.
  • End of game success and failure sounds.
  • A game play popover to explain how to play the game.
  • A fair amount of restructuring of the code.

Word Craft

WordCraft is a game where you have to use a limited number of letters to create a word. To make the game more challenging, you will be given a challenge to meet, such as a word with a specific number of letters or a word that starts with a specific letter.

Word craft game

There is no time limit to complete the challenge, but you must meet the challenge and you cannot use the same word more than once.

Letters you use to successfully create a word will be removed from the game board and replaced with a random set of replacement letters.

Like Minesweeper, Word Craft was a project created by Paul Hudson in his Hacking with Swift+ live streams . The game he presented worked well, but left a lovely amount of space for extension.

My extensions to this game were to:

  • Added a keyboard interface so you can select letters using the keyboard rather than clicking them.
  • Sound feedback while playing the game and when old tiles are removed and new tiles added.
  • An optional log of used words so you can see words you have used before.
  • An optional preview of the word you are creating.
  • Popup feedback when you fail the game rule.
  • The ability to refresh the rule if it is too difficult.
  • A restart game button.
  • A game play popover to explain how to play the game.
  • Some restructuring of the code.

Snake Game

This is a classic game from the early days of computing. The premis is very simple but game play is surprisingly difficult the longer you play.

Snake game

Your job is to guide the snake towards it's food. The snake will grow longer as it eats food. If it touches the borders or itself, it will die. As the game progresses and the snake grows longer and longer, you will need to work out routes to the food that will not cause the snake to die.

The game is very addictive and can be played for hours. It is a great way to spend a few minutes.

Where is it?

Can I have a copy?

The code is available in my Time Wasters GitHub repo. It's a work in progress project that I plan to add more games to over time.

Testimonials
Testimonials

Am I really any good?

Don't take my word for my abilities, take a look at other peoples opinions about me.