Giter VIP home page Giter VIP logo

shape-shifter's Introduction

Shape Shifter - A pattern matching puzzle game

Background and Overview

Live Demo

Shape Shifter is a simple yet stimulating puzzler inspired by the ancient Chinese game called Tangram.

The game is held within the shape of a square, and consists of seven pieces - five triangles, a square, a rhomboid - which may be arranged to form a variety of different shapes.

alt text

This was built only with HTML, CSS, and JavaScript:

  <div class="shape" id="sm-triangle2">
    <svg height="150" width="75" viewbox="0 0 75 150">
      <polygon points="75,0 75,150 0,75 75,0"
      fill="rgb(0, 64, 229)"/>
    </svg>
  </div>

  <div class="shape" id="rhomboid">
    <svg height="75" width="225" viewbox="0 0 225 75">
      <polygon points="0,75 150,75 225,0 75,0 0,75"
      fill="rgb(229, 0, 206)"/>
    </svg>
  </div>

Shapes were created as svg polygons and wrapped with a shape class that handled css binding for click and drag functionality and transformations to rotate.

Gameplay

The player can select an image from the scroll menu and is shown a silhouette that must be recreated with all seven of the pieces to match identically.

If a player gets stuck, they can see the solution for the current puzzle:

alt text

Future Implementation

In the future I would like to include more puzzles and further improve the logic for shape functionality.

shape-shifter's People

Contributors

eschwalm avatar

Watchers

James Cloos avatar

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.