Permalink
Browse files

Added instructions to homepage, refactored collision function

  • Loading branch information...
dakotahducharme committed Jan 11, 2019
1 parent 7eebcd8 commit 4774a0b3c02700b9aca693bf9f11d1f6cbbb88a2
Showing with 13 additions and 6 deletions.
  1. +1 −1 css/style.css
  2. +3 −0 index.html
  3. +9 −5 js/app.js
@@ -80,7 +80,7 @@ footer {
opacity: 100%;
}

#ask-name, #map-color, .welcome {
#ask-name, #map-color, .homepage p {
padding-top: 60px;
text-align: center;
font-size: 28px;
@@ -21,6 +21,9 @@ <h1><img id="pokawaii-gif" src="pokawaii.gif" alt="Pokawaii!"></h1>
</nav>
</header>
<div class="homepage">
<p>Welcome to Pokawaii! The cutest version of all of your favorite games mixed together! The objective of the game is to collect all of the items on the screen for each character! Once you've collected all of the items, you might attract a Pokemon! Press start to begin, and then choose your character.</br>
Use your arrow keys or WASD keys to move your character around
</p>
<button id="start" type="button">Start</button>
</div>

@@ -36,7 +36,7 @@ const options = {
const coinCount = 10;
const coinSize = {
x: 25,
y: 35,
y: 40,
}

let coins = []
@@ -214,16 +214,20 @@ function checkForWin() {
}
}

function between(checking, start, end) {
return (start <= checking && checking <= end);
}

function axisOverlap(range1, range2) {
if (
// range2.start inside range1
(range1.start <= range2.start && range2.start <= range1.end)
between(range2.start, range1.start, range1.end)
// range2.end inside range1
|| (range1.start <= range2.end && range2.end <= range1.end)
|| between(range2.end, range1.start, range1.end)
// range1.start inside range2
|| (range2.start <= range1.start && range1.start <= range2.end)
|| between(range1.start, range2.start, range2.end)
// range1.end inside range2
|| (range2.start <= range1.end && range1.end <= range2.end)
|| between(range1.end, range2.start, range2.end)
) {
return true
} else {

0 comments on commit 4774a0b

Please sign in to comment.