Coder Social home page Coder Social logo

emoji-flyer's Introduction

  ______                 _ _   ______ _                 _ 
 |  ____|               (_|_) |  ____| |               | |
 | |__   _ __ ___   ___  _ _  | |__  | |_   _  ___ _ __| |
 |  __| | '_ ` _ \ / _ \| | | |  __| | | | | |/ _ \ '__| |
 | |____| | | | | | (_) | | | | |    | | |_| |  __/ |  |_|
 |______|_| |_| |_|\___/| |_| |_|    |_|\__, |\___|_|  (_)
                       _/ |              __/ |            
                      |__/              |___/             
----------------------------------------------------------------- 

This is an example project!

This is meant to demonstrate how to make a simple game with just HTML, CSS, and JavaScript (including jQuery).

How to play

Use the arrow keys to move the bird around the screen, avoiding obstacles.

Either clone this repo and open index.html, or play here: https://rawgit.com/stormsweeper/emoji-flyer/master/

How it works

When the game is started, a timer is started, and each "tick" these steps happen:

  1. New obstacles are added randomly.
  2. Obstacles on the stage are moved
  3. Collisions are checked (e.g. the bird is touching a car)

Collisions are also checked when the bird is moved via keyboard commands.

Some of the bits used here:

  • CSS transforms (some of the emoji are flipped)
  • setInterval for the timer
  • jQuery click and keydown event handlers
  • for loops to check all items of a type
  • Math.random() for choosing which emojis to use or adding obstacles
  • arrays and objects for storing data

emoji-flyer's People

Contributors

stormsweeper 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.