Giter Site home page Giter Site logo

butterflies's Introduction

#Lydia Butterfly

##About

Lydia Butterfly is a speed-based color puzzle game, dedicated to my niece Lydia. The first version of this game was launched on April 11th, 2014, after about four and a half days of development as a project for Omaha Code School.

Play it here!

##How to Play

###Directions

  1. Click Start.
  2. Click sections to change their color.
  3. Keep clicking until sections no longer match adjacent sections.

An example of a winning game:

Winning game example

###Other Tips

  • Level 1 gives you 30 seconds to solve the puzzle. Each subsequent level decreases your time limit by 2 seconds, down to a minimum of 7 seconds.
  • The computer will randomly change colors on the butterfly, so watch out!
  • You can play as much as you would like without signing up, but if you do sign up, the game will keep track of your personal stats, and you will also be eligible for the high score table.

Technical Stuff

(If you're interested in that kind of thing)

Lydia Butterfly is a Rails application, but Javascript is primarily what's making the game run, such as the timer mechanism, changing colors on click, randomly changing colors, automatically saving games, etc.

The butterfly itself is an SVG object that I created in Adobe Illustrator CC, because it was significantly simpler than cobbling together divs holding images, or drawing an HTML map over one image. Having each polygon in its own polygon tag simplified the process of manipulating the game using Javascript and CSS. The code for the SVG object lives in app/views/games/new.html.erb if you are interested in SVG objects and would like to check that out.

The code that is doing most of the heavy lifting in the game is located in app/assets/javascripts/games.js.

##Suggested Browsers

###Good:

  • Chrome (Mac and Windows)
  • Safari (Mac and iPhone)
  • Opera (Mac)
  • Firefox (Mac and Windows)
  • Internet Explorer (Windows)

###Untested:

  • Safari (Windows)
  • Opera (Windows)
  • Anything else not explicitly listed

##The Future of Lydia Butterfly

I'm constantly trying to make the Lydia Butterfly experience better, so please report any bugs or suggestions in the issues section! Please be as descriptive about bugs as possible (what you did that lead up to the bug, pictures of glitches, etc.). Thanks!

butterflies's People

Contributors

kittee avatar

Stargazers

Joseph Dykstra avatar Matt Hova avatar

Watchers

 avatar

butterflies's Issues

Gameplay

  • Click on a section, it changes colors
  • Computer randomly changes colors of sections after x amount of time
  • Logic for when a game is won
  • Progression to the next level
  • Level design
  • Timer
  • Logic for when a game is lost

Presentation preparation

Introduction

  • Lydia Butterfly was named after my cousin Kenny's daughter.
  • Drew her a butterfly before she was born that inspired the game
  • (Some of you know Marcus. Kenny is Marcus's fraternal twin.)

Demo

How to Play

  • Butterfly has a max of 4 colors: red, yellow, green, and blue
  • Once you hit start, click sections until they no longer match the color of the section next to them
  • If you don't fix the butterfly before time runs out, it's game over

Music

  • Toggles off and on

Scoring

  • Starts at level 1; time decreases every level to a minimum of 7 seconds
  • A level's score is your remaining time times the level number

Stats

  • Anyone can play, but you can only make it to the high score table if you have account.
  • If you have an account, you can also see your personal top 10.

Color problems

  • Game is accessible for people who are color-blind.
  • This was important to me because Kenny is color-blind, and it would be silly to name a game after his daughter and not have it be accessible to him.
    • Growing up, when we played puzzle games that relied on colors, Kenny couldn't play them.
  • Show comparison image.
  • The most common type of colorblindness is deuteranopia, which is the inability to differentiate between red and green. You can accommodate for this by making your reds lean towards orange and your greens lean towards blue.

Code Share

SVG

  • Not an image with mapping
  • Not individual divs
  • SVG = Scalable Vector Graphic

Tuesday - Static Site

  • Finish database and models
  • Finish basic views
  • Start Javascript/Ajax interactivity

Project Plan for Butterflies

Overview

Butterflies (working title) is a simple color game. The player is given a butterfly that is divided into many different sections. The player's goal is to make each section a different color from the sections it is adjacent to in a given amount of time. There are 4 different colors.


Concept art

butterfly

The butterfly has 20 sections total, 10 on each wing, which is then divided into 6 sections on the top half and 4 sections on bottom.


User Experience

Views

Layout

  • Navigation bar on top
    • If logged out:
      • Sign In
      • Sign Up
    • If logged in:
      • Welcome (username)
      • Your Stats
      • Sign Out
    • Viewable by everyone:
      • New Game
      • High Scores
  • Content below

Home page

  • The first page the user encounters has a navigation bar on top and the game below. Anyone can play, but people who are not logged in cannot save a history of their games and cannot place on the high score table.
  • The user can log in or sign up by clicking the appropriate links, and the necessary fields show up in the navigation bar once a link is clicked.

Your Stats

  • Essentially the "show" page for Users. Contains a table of personal high scores and what place the user is in out of all users.

High Scores

  • Essentially the "index" page for Games. Shows the top scores out of all players, in groups of 10. The user can click "show more" at the bottom to append more high scores.

Models

User

Attributes

  • email
    • must be unique
  • username
    • must be unique
    • must have only letters, numbers, and underscores
  • password_digest

Relationships

  • Has many games

Other

  • has_secure_password

Game

Attributes

  • user_id
  • final_score

Relationships

  • Belongs to user
  • Has many ??? (levels?)

How to Play animation

  • Have a button on the home page next to "Start" that says "Demo"
  • Animation showing directions and how to play

Not resizing properly in some browsers

Working browsers:

  • Chrome (Mac)
  • Chrome (Windows)
  • Safari (Mac)
  • Firefox (Mac)
  • Firefox (Windows)
  • Opera (Mac)
  • Internet Explorer (Windows)

Problem browsers:

  • None currently

Need to check:

  • Opera (Windows)
  • Safari (Windows)

User login

  • Login controller
  • Sign up/log in without navigating away from the main page using jQuery

Requirements

Need to make sure I actually do all the project requirements.

  • One-many-many relationship
  • User authentication
  • 2 instances of ajax
  • 1 email
  • Deliberate design
  • 1 CSS sprite

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.