Skip to content

Inspired by the classic Frogger game, dash to the other side while avoiding the deadly lady bugs.

License

Notifications You must be signed in to change notification settings

brianquach/html5-frogger-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canvas Arcade Game

Enjoy this HTML 5 Canvas game based off the classic Frogger game. Avoid the moving bugs and reach the water on the opposite side of the starting point to win the game!

Demo Here.

Table of Contents

How To Play

Customizing Game

If you're a developer and want to customize the game by adding more enemies or creating custom event triggers you can easily do so using the examples below. All code to add enemies/events or customize player should go inside the gameInit() function inside app.js.

To add more enemies you can instantiate an Enemy object by passing it a configuration object like so:

global.allEnemies = [];
global.allEnemies.push(new Enemy({
  sprite: 'images/bug.png',  // Url of image to use as enemy
  x: -75,  // X canvas position to render the enemy start position
  y: 62,  // Y canvas position to render the enemy start position
  speed: 2 // Integer value that will be multipled by 100 to set enemy movement speed
}));

To add more events you can instantiate an GameEvent object by passing it a configuration object like so:

global.allEvents = [];
global.allEvents.push(new GameEvent({
  name: 'GameWin',  // Name of event
  x: 0,  // X canvas position to render event boundary
  y: 0,  // Y canvas position to render event boundary
  hitBoxWidth: 100,  // Width of event hit box
  hitBoxHeight: 100,  // Height of event hit box
  // List of functions that will trigger when the associated event is called
  triggerEvents: [{
    trigger: 'touch',  // Event name that will trigger the respFunc
    // respFunc will only execute when the 'touch' event is called
    respFunc: function() {
      alert('Hello, world');
    }
  }]
}));

*Note: Currently the only game trigger event that will trigger is the 'touch' event.

Creator

Brian Quach

Copyright and license

Code copyright 2016 Brian Quach. Code released under the MIT license.

About

Inspired by the classic Frogger game, dash to the other side while avoiding the deadly lady bugs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published