four-in-a-row

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 24 Imported by: 0

README

Four In A Row - 2 Player Arcade Game

Go Report Card

Connect Four (also known as Captain's Mistress, Four Up, Plot Four, Find Four, Four in a Row, Four in a Line, Drop Four, and Gravitrips (in Soviet Union)) is a two-player connection game in which the players first choose a color and then take turns dropping one colored disc from the top into a seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs.

-- Wikipedia

Puzzle Board

How to play?

  • Point the cursor over the column you wish to drop your disc in
  • Left click to drop your disc
  • When you can connect four discs vertically, horizontally or diagonally you win

Features Implemented/Pending

  • Basic Four In A Row / Connect Four game
  • Colorful, glossy disc images
  • Dice dropping and win sound
  • Intro screen with instructions
  • Pause screen
  • Restart at anytime (from pause screen)
  • Choosing Player name and pawn color
  • Play (move and drop) with keyboard
  • Background images using Unsplash API
  • Change Background in the middle of game (from pause screen)

Development Notes

To fix any bug, improve or just to explore -

  1. Clone this repo
  2. Create .env by copying the .env.dist file
  3. If you don't want to use Unsplash backgrounds, just keep the UNSPLASH_ACCESS_KEY empty
  4. I Recommend using Unsplash, as it's a huge collection of high quality photos with a totally free API. It's simple!
    • Create your Developer Account
    • Create a collection to group up your curated photos.
    • Set the collection ID as UNSPLASH_COLLECTION_ID in .env file

Suggestions and Pull Requests are welcome!

Motivation

We have a puzzle toy board of Four-In-A-Row and my kids enjoy it very much! One day, they asked to make it a computer game so that they can play it from the MacBook.

Puzzle Board

Then, I have searched around for an easy 2D game engine in Golang and chosen Pixel. Pixel, with it's easy to follow wiki, made it fun to bring this game in existence within a very short time.


O mankind, what has deceived you concerning your Lord, the Generous!
-- Al-Quran 42:6

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL