-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds assets and changes the main design
- Loading branch information
Helio S. Junior
committed
Feb 21, 2019
1 parent
421e8e4
commit b7a639b
Showing
7 changed files
with
118 additions
and
36 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
var money = 0; | ||
var click_value = 1; | ||
var helper_count = 0; | ||
const office = document.getElementById('office'); | ||
const employers = document.querySelector('#office > .employers') | ||
|
||
window.onload = function startGame(){ | ||
document.getElementById('office').addEventListener("click", click, false); | ||
document.getElementById('improve_self').addEventListener("click", improveSelf, false); | ||
document.getElementById('hire_help').addEventListener("click", hireHelp, false); | ||
outsourcedMoney(); | ||
updateMoney(); | ||
document.getElementById('office').addEventListener("click", click, false); | ||
document.getElementById('improve_self').addEventListener("click", improveSelf, false); | ||
document.getElementById('hire_help').addEventListener("click", hireHelp, false); | ||
outsourcedMoney(); | ||
updateMoney(); | ||
}; | ||
|
||
function outsourcedMoney() { | ||
money = money + helper_count; | ||
updateMoney(); | ||
setTimeout(outsourcedMoney, 1000); | ||
money = money + helper_count; | ||
updateMoney(); | ||
setTimeout(outsourcedMoney, 1000); | ||
} | ||
|
||
function updateMoney() { | ||
document.getElementById('money').innerHTML= "You have: $"+money | ||
document.getElementById('money').innerHTML = money | ||
} | ||
|
||
function improveSelf() { | ||
if(money > (Math.pow(click_value,2))){ | ||
money = money - (Math.pow(click_value,2)); | ||
updateMoney(); | ||
click_value++; | ||
} | ||
if(money > (Math.pow(click_value,2))){ | ||
money = money - (Math.pow(click_value,2)); | ||
updateMoney(); | ||
click_value++; | ||
} | ||
} | ||
|
||
function click(){ | ||
money = money + click_value; | ||
updateMoney(); | ||
money = money + click_value; | ||
updateMoney(); | ||
} | ||
|
||
function hireHelp() { | ||
if(money > (Math.pow(helper_count, 2)+1)){ | ||
money = money - (Math.pow(helper_count, 2)+1); | ||
updateMoney(); | ||
helper_count ++; | ||
addNewHelper(); | ||
} | ||
if(money > (Math.pow(helper_count, 2) + 1)) { | ||
money = money - (Math.pow(helper_count, 2)+1); | ||
updateMoney(); | ||
helper_count++; | ||
addNewHelper(); | ||
} | ||
} | ||
|
||
function addNewHelper() { | ||
office.innerHTML += '<img class="character" src="assets/images/main_guy.png">' | ||
} | ||
employers.innerHTML += '<img class="character" src="assets/images/main_guy.png">' | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,78 @@ | ||
@font-face { | ||
font-family: arcadeclassic; | ||
src: url('../fonts/ARCADECLASSIC.ttf'); | ||
} | ||
|
||
body, html { | ||
background: #000; | ||
font-family: arcadeclassic; | ||
} | ||
|
||
#game { | ||
background: #261C2A; | ||
width: 50%; | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 800px; | ||
height: 750px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
background-image: url('../images/floor.jpg'); | ||
background-size: 10rem; | ||
|
||
-webkit-touch-callout: none; | ||
-webkit-user-select: none; | ||
-khtml-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
} | ||
|
||
#office { | ||
height: calc(750px - 4rem); | ||
} | ||
|
||
#office > .employers { | ||
padding: 1rem; | ||
} | ||
|
||
#office > .employers > .you { | ||
display: flex; | ||
justify-content: center; | ||
margin-bottom: 2rem; | ||
} | ||
|
||
.stats { | ||
background: #ffffff; | ||
background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); | ||
background: -webkit-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); | ||
background: linear-gradient(to bottom, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); | ||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6', GradientType=0); | ||
|
||
display: flex; | ||
height: 4rem; | ||
justify-content: space-between; | ||
padding-right: 1rem; | ||
padding-left: 1rem; | ||
} | ||
|
||
.stats__money { | ||
display: flex; | ||
justify-content: space-between; | ||
width: 60px; | ||
align-items: center; | ||
font-size: 19px; | ||
} | ||
|
||
.wall { | ||
height: 80px; | ||
background-image: url('../images/wall.jpg'); | ||
} | ||
|
||
.character { | ||
height: 50px; | ||
} | ||
height: 50px; | ||
margin-right: .3rem; | ||
} | ||
|
||
footer { | ||
display: flex; | ||
align-self: center; | ||
justify-content: center; | ||
margin-top: 1rem; | ||
} |
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