This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var content = $('#index-content-well'); | |
var image = $('#lead-image'); | |
content.on('scroll', function(){ | |
var total_height = content.get(0).scrollHeight - content.height(); | |
var position = Math.abs(Math.round((content.scrollTop() / total_height) * 100) - 100); | |
var value = 'grayscale(' + position +'%)'; | |
image.css('-webkit-filter', value); | |
image.css('-moz-filter', value); | |
image.css('filter', value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
concat: { | |
options: { | |
separator: ';' | |
}, | |
dist: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
express = require('express'), | |
app = express(), | |
port = 8080 | |
; | |
//Set the 'static' directory to the project root - where index.html resides | |
app.use(express.static('./')); | |
//When root is requested, send index.html as a response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CanyonRunner.Preloader = function (game) { | |
this.ready = false; | |
}; | |
CanyonRunner.Preloader.prototype = { | |
preload: function () { | |
this.background = this.add.sprite(0, 0, 'desert-open'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"resources": [ | |
"audio.ogg", | |
"audio.m4a", | |
"audio.mp3", | |
"audio.ac3" | |
], | |
"spritemap": { | |
"3rdBallad": { | |
"start": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleUserDataGameLoss: function() { | |
//Handle Player Scores and Times | |
this.interval = 0; | |
this.step = this.playerStats.topScore - this.interval; | |
if (this.score > this.step) { | |
this.playerStats.topScore = this.interval + this.score; | |
} | |
this.playerStats.topTime = this.playerStats.topTime + this.survivalTimer.seconds; | |
localStorage.setItem('Canyon_Runner_9282733_playerStats', JSON.stringify(this.playerStats)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////// | |
//READ LOCAL STORAGE | |
////////////////////// | |
this.playerStats; | |
if (localStorage.getItem('Canyon_Runner_9282733_playerStats') != null) { | |
this.playerStats = JSON.parse(localStorage.getItem('Canyon_Runner_9282733_playerStats')); | |
} else { | |
this.playerStats = { topScore: 0, topTime: 0, returnPlayerToState: 'HowToPlay'}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CanyonRunner.Level1.prototype = { | |
create: function() { | |
//START MUSIC | |
/////////////////// | |
this.sound = this.game.add.audioSprite('sound'); | |
this.sound.play('aronara'); | |
////////////////// | |
//SET BACKGROUND | |
////////////////// |
OlderNewer