Permalink
Browse files

init

  • Loading branch information...
RossMcMillan92 committed Feb 1, 2016
0 parents commit a1beff2c5106981fc038b21c676ff2a7941d468c
Showing with 3,984 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. BIN apple-touch-icon-114x114-precomposed.png
  3. BIN apple-touch-icon-144x144-precomposed.png
  4. BIN apple-touch-icon-57x57-precomposed.png
  5. BIN apple-touch-icon-72x72-precomposed.png
  6. BIN apple-touch-icon-precomposed.png
  7. BIN apple-touch-icon.png
  8. BIN assets/.DS_Store
  9. +266 −0 assets/css/master.css
  10. +283 −0 assets/css/style.css
  11. BIN assets/img/bg.jpg
  12. +25 −0 assets/js/app/background.js
  13. +32 −0 assets/js/app/collisions.js
  14. +126 −0 assets/js/app/enemy.js
  15. +38 −0 assets/js/app/health.js
  16. +42 −0 assets/js/app/image-map.js
  17. +61 −0 assets/js/app/item.js
  18. +53 −0 assets/js/app/keyboard.js
  19. +28 −0 assets/js/app/loop.js
  20. +119 −0 assets/js/app/movable.js
  21. +86 −0 assets/js/app/particle.js
  22. +91 −0 assets/js/app/player.js
  23. +12 −0 assets/js/app/tools.js
  24. +341 −0 assets/js/build.bundle.js
  25. +85 −0 assets/js/build.js
  26. +2 −0 assets/js/plugins/domready.js
  27. +85 −0 assets/js/script.js
  28. +9 −0 assets/sass/1-settings/_breakpoints.scss
  29. +12 −0 assets/sass/1-settings/_content-structure.scss
  30. +1 −0 assets/sass/1-settings/_debug.scss
  31. +21 −0 assets/sass/1-settings/_fonts.scss
  32. +54 −0 assets/sass/1-settings/_palette.scss
  33. +58 −0 assets/sass/2-tools/_generic.scss
  34. +17 −0 assets/sass/2-tools/_mediaqueries.scss
  35. +12 −0 assets/sass/2-tools/_units.scss
  36. BIN assets/sass/3-generic/.DS_Store
  37. +15 −0 assets/sass/3-generic/_clearfix.scss
  38. +168 −0 assets/sass/3-generic/_debug.scss
  39. +3 −0 assets/sass/3-generic/_generic.scss
  40. +428 −0 assets/sass/3-generic/_normalize.scss
  41. BIN assets/sass/4-base/.DS_Store
  42. +28 −0 assets/sass/4-base/_fonts.scss
  43. +18 −0 assets/sass/4-base/_global.scss
  44. +31 −0 assets/sass/4-base/_headings.scss
  45. 0 assets/sass/4-base/_links.scss
  46. 0 assets/sass/4-base/_lists.scss
  47. +48 −0 assets/sass/4-base/_paragraphs.scss
  48. +56 −0 assets/sass/4-base/_shared-margins.scss
  49. +34 −0 assets/sass/4-base/_tables.scss
  50. +20 −0 assets/sass/5-objects/_animations.scss
  51. +135 −0 assets/sass/5-objects/_content-section.scss
  52. +9 −0 assets/sass/5-objects/_expandable.scss
  53. +232 −0 assets/sass/5-objects/_grids.scss
  54. +94 −0 assets/sass/5-objects/_icons.scss
  55. +10 −0 assets/sass/5-objects/_justified-section.scss
  56. +70 −0 assets/sass/5-objects/_lists.scss
  57. +56 −0 assets/sass/5-objects/_media.scss
  58. +29 −0 assets/sass/5-objects/_position.scss
  59. +11 −0 assets/sass/5-objects/_pseudo.scss
  60. +35 −0 assets/sass/5-objects/_slider.scss
  61. +5 −0 assets/sass/5-objects/_text.scss
  62. +63 −0 assets/sass/7-trumps/_helper.scss
  63. +78 −0 assets/sass/master.scss
  64. BIN favicon.ico
  65. +75 −0 gulp/config.js
  66. +8 −0 gulp/tasks/browserSync.js
  67. +7 −0 gulp/tasks/errorHandler.js
  68. +14 −0 gulp/tasks/mocha.js
  69. +33 −0 gulp/tasks/scripts.js
  70. +41 −0 gulp/tasks/styles.js
  71. +20 −0 gulp/tasks/watch.js
  72. +60 −0 gulpfile.js
  73. +41 −0 index.html
  74. +47 −0 package.json
@@ -0,0 +1,3 @@
.sass-cache/
node_modules/
npm-debug.log
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN +1.2 KB apple-touch-icon.png
Binary file not shown.
BIN +6 KB assets/.DS_Store
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,283 @@
/*! normalize.css v1.1.0 | MIT License | git.io/normalize */article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html,
button,
input,
select,
textarea {
font-family: sans-serif;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: .83em;
margin: 1.67em 0;
}
h6 {
font-size: .67em;
margin: 2.33em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
blockquote {
margin: 1em 40px;
}
dfn {
font-style: italic;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
mark {
background: #ff0;
color: #000000;
}
p,
pre {
margin: 1em 0;
}
code,
kbd,
pre,
samp {
font-family: monospace,serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
q {
quotes: none;
}
q:before,
q:after {
content: '';
content: none;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
dl,
menu,
ol,
ul {
margin: 1em 0;
}
dd {
margin: 0 0 0 40px;
}
menu,
ol,
ul {
padding: 0 0 0 40px;
}
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
img {
border: 0;
-ms-interpolation-mode: bicubic;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
form {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
white-space: normal;
*margin-left: -7px;
}
button,
input,
select,
textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle;
}
button,
input {
line-height: normal;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
*overflow: visible;
}
button[disabled],
html input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
*height: 13px;
*width: 13px;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html {
height: 100%;
overflow: hidden;
background: url('../img/bg.jpg');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
font-family: 'Lato', sans-serif;
-webkit-font-smoothing: antialiased;
}
canvas{
display: block;
width: 100%;
height: 100%;
cursor: pointer;
}
.info{
position: absolute;
bottom: 1em;
right: 1em;
text-align: right;
}
.info__item{
font-weight: 300;
color: #fff;
text-transform: uppercase;
white-space: nowrap;
}
.info__separator{
margin: 0 .5em;
}
.info__item--link{
text-decoration: underline;
}
.info__item--link:hover{
color: #fff;
}
BIN +113 KB assets/img/bg.jpg
Binary file not shown.
@@ -0,0 +1,25 @@
const Background = (url) => {
const image = new Image();
let hasLoaded = false;
image.onload = () => hasLoaded = true;
image.src = url;
const render = (ctx, constraints, camera) => {
if(!hasLoaded) return;
const [width, height] = constraints;
const pattern = ctx.createPattern(image, 'repeat');
ctx.rect(0, 0, width, height);
ctx.fillStyle = pattern;
ctx.fill();
}
return {
render
};
}
export default Background;
@@ -0,0 +1,32 @@
const detectCollision = (item1) => (item2) => {
let [item1LeftEdge, item1RightEdge, item1TopEdge, item1BottomEdge] = item1;
let [item2LeftEdge, item2RightEdge, item2TopEdge, item2BottomEdge] = item2;
let overlapsX = item1RightEdge > item2LeftEdge && item1LeftEdge < item2RightEdge;
let overlapsY = item1BottomEdge > item2TopEdge && item1TopEdge < item2BottomEdge;
let hasCollided = overlapsY && overlapsX
if(!hasCollided) return false
let dir = {};
let axis = 0;
let leftOverlap = Math.abs(item1RightEdge - item2LeftEdge);
let rightOverlap = Math.abs(item1LeftEdge - item2RightEdge);
let topOverlap = Math.abs(item1BottomEdge - item2TopEdge);
let bottomOverlap = Math.abs(item1TopEdge - item2BottomEdge);
dir.x = leftOverlap < rightOverlap ? -1 : 1,
dir.y = topOverlap < bottomOverlap ? -1 : 1
axis = (dir.x < 0 ? leftOverlap : rightOverlap) < (dir.y < 0 ? topOverlap : bottomOverlap) ? 'x' : 'y';
return {
axis: axis,
direction: dir[axis]
};
}
export { detectCollision }
Oops, something went wrong.

0 comments on commit a1beff2

Please sign in to comment.