This file contains hidden or 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
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| <script type="text/javascript" src="https://raw.github.com/tuupola/jquery_lazyload/master/jquery.lazyload.min.js"></script> | |
| <script type="text/javascript"> | |
| $(function() { | |
| var images = $('[data-original]'); | |
| images.lazyload({ | |
| effect: 'fadeIn' | |
| }); | |
| }); | |
| </script> |
This file contains hidden or 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
| # Loop through the whole tileset and create rectangles | |
| # for each tile position. | |
| tileIndex = 0 | |
| for y in [0..@tilesHigh] | |
| for x in [0..@tilesWide] | |
| @tileRectangles[tileIndex] = new Rectangle( | |
| x * @tileWidth, | |
| y * @tileHeight, | |
| @tileWidth, | |
| @tileHeight |
This file contains hidden or 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
| # | |
| # Choro - Tileset | |
| # Copyright (c) 2012 Nico Hämäläinen <nico@bender.fi> | |
| # MIT Licensed | |
| # | |
| # | |
| # Events: | |
| # - tilesetImageLoaded | |
| # This event is emitted when the initial tileset graphic is loaded |
This file contains hidden or 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
| # | |
| # Choro - Map Layer | |
| # Copyright (c) 2012 Nico Hämäläinen <nico@bender.fi> | |
| # MIT Licensed | |
| # | |
| # Inspired by node-validator | |
| # | |
| net = require 'net' | |
| # Regular expressions |
This file contains hidden or 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
| # | |
| # Choro - Tileset | |
| # Copyright (c) 2012 Nico Hämäläinen <nico@bender.fi> | |
| # MIT Licensed | |
| # | |
| # | |
| # Events: | |
| # - tilesetImageLoaded | |
| # This event is emitted when the initial tileset graphic is loaded |
This file contains hidden or 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
| #ifndef ENGINE_H | |
| #define ENGINE_H | |
| #include "SDL.h" | |
| /** The base engine class **/ | |
| class CEngine { | |
| private: | |
| /** Last iteration's tick value **/ |
This file contains hidden or 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
| #include "Engine.h" | |
| /* #include <windows.h> // For the WaitMessage() function. */ | |
| /** Default constructor. **/ | |
| CEngine::Cengine() | |
| { | |
| m_lLastTick = 0; | |
| m_iWidth = 800; | |
| m_iHeight = 600; | |
| m_czTitle = 0; |
This file contains hidden or 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
| #include <stdlib.h> | |
| #include <GL/glew.h> | |
| #ifdef __APPLE__ | |
| # include <GLUT/glut.h> | |
| #else | |
| # include <GL/glut.h> | |
| #endif | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include "util.h" |
This file contains hidden or 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
| EventEmitter = () -> | |
| EventEmitter.prototype = | |
| # Add a new listener for an event | |
| bind: (event, func) -> | |
| this._events = this._events or {} | |
| this._events[event] = this._events[event] or [] | |
| this._events[event].push(func) | |
| # Remove a listener for an event | |
| unbind: (event, func) -> |
This file contains hidden or 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
| splitArray = (array, chunkSize) -> | |
| result = [] | |
| while (array.length) | |
| result.push(array.splice(0, chunkSize)) | |
| result |