Giter Club home page Giter Club logo

line-98's Introduction

Table of Contents

What is this? (・・ ) ?

This is a random repository on github in which contains a lot of random nonsense, broken English grammar, an dozen of kaomoji and among that maybe you can find a mini match-3 puzzle game implementation using plain javascript.

This repo make use of p5.js, which provide a minimum game loop and a rich set of API to work with HTML canvas. Game preview

How to use σ( ̄、 ̄〃)

Run as a browser game

Simply clone this repo through git

git clone https://github.com/Kspade224/line-98.git

And open the file game.html using a browser

Run as a desktop app

The game can also be run as a desktop app using Electron. Please change to the electron branch to learn more.

How to play ( ̄~ ̄;)

Scoring

The player select a ball in the play field and move it to a new location in an attempt to make a horizontally or vertically matching group of 3 or more balls with the same color.

The player gains point after said group was demolished from the screen ←~(Ψ▼ー▼)∈

After each turn, a few new ball will appear to fill up the board, and the game is over if the board is full.

... well ... actually the gameover mechanic has not been implemented yet ⊂( ̄▽ ̄)⊃

Implementation

Why Javascript?

The HTML canvas + Javascript combination is very suitable for making short, simple mechanic puzzle game, and is a very short way to see exactly what you just implemented.

Its also required very little preparation (the use of external libraries is entirely optional) compare to using a standard game engine.

Algorithm

The backbone of this game is the A-star path-finding algorithm, which is an "extension" of the Dijkstra's algorithm.

In this implementation, we consider each grid on the play field is a node in a graph and every connection between 2 node has the weight of 1.

These are very good explainations of Dijkstra's algorithm and A-star algorithm in case you are not familiar with them.

Programming pattern

The game make use of the "State design pattern" to ensure its performance. You can learn more about it here.

Future features (which may never got implemented)

Better UI

Gameover mechanic

A separate config view

Reference

Computerphile - My savior and daily entertainment source during college days ╰(▔∀▔)╯

The Coding Train - Where I discover p5.js and a ton of great mini-game implementations (ノ´ з `)ノ

Game Programming Pattern - The first book that I read about game programming, and it is free w(°o°)w

line-98's People

Contributors

jev-git avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

drthinh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.