Skip to content

Instantly share code, notes, and snippets.

Avatar

Steven Lambert straker

View GitHub Profile
@straker
straker / README.md
Last active Mar 3, 2021
Basic Sokoban HTML Game
View README.md

Basic Sokban HTML Game

This is a basic implementation of the game Sokoban, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • More levels
    • Add more levels and have the next level start once the last one is finished
@straker
straker / README.md
Last active Mar 6, 2021
Basic Missile Command HTML Game
View README.md

Basic Missile Command HTML Game

This is a basic implementation of the Atari Missile Command game, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

  • Score
    • When a missile explodes (not a counter-missile), the score should increase by 25
@straker
straker / README.md
Last active Jan 13, 2021
Basic Frogger HTML Game
View README.md

Basic Frogger HTML Game

This is a basic implementation of the Konami Frogger game, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

  • Lives
    • Frogger starts with 6 lives and should lose a life whenever it is hit by a vehicle or lands in the water
@straker
straker / README.md
Last active Feb 4, 2021
Basic Bomberman HTML Game
View README.md

Basic Bomberman HTML Game

This is a basic implementation of the NES game Bomberman, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

  • Player death
    • The player should die when it is hit by an explosion from a bomb
@straker
straker / README.md
Last active Mar 3, 2021
Basic Tetris HTML Game
View README.md

Basic Tetris HTML Game

This is a basic implementation of the game Tetris, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

@straker
straker / README.md
Last active Jan 13, 2021
Basic Pong HTML Game
View README.md

Basic Pong HTML Game

This is a basic implementation of the Atari Pong game, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

  • Score
    • When a ball goes past a paddle, the other player should score a point. Use context.fillText() to display the score to the screen
@straker
straker / README.md
Last active Feb 24, 2021
Basic Breakout HTML Game
View README.md

Basic Breakout HTML Game

This is a basic implementation of the Atari Breakout game, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

  • Lives
    • The player should have 3 chances to remove all the bricks. Display how many lives the player currently has using context.fillText(). Remove a life when the ball goes below the screen
@straker
straker / README.md
Last active Feb 24, 2021
Basic Snake HTML Game
View README.md

Basic Snake HTML Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

image

Further Exploration

  • Score
    • When the snake eats an apple, the score should increase by one. Use context.fillText() to display the score to the screen
@straker
straker / nativeDomAPI.js
Last active Jan 14, 2016
HTML DOM api standards proposal - examples of how the native HTML DOM api is cumbersome to use and how different libraries handle it
View nativeDomAPI.js
/**
* Create element with attributes
*
* <input type="number" min="0" max="99" name="number" id="number" class="number-input" disabled/>
*/
// native
var input = document.createElement('input');
input.type = "number";
input.min = 0;
@straker
straker / two-way-binding.js
Last active Feb 23, 2021
Simple and small two-way data binding between DOM and data
View two-way-binding.js
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes