@MarkelL/

Money Suit

HTML, CSS, JS

Game for the Game Jam

fork
loading
Files
  • index.html
  • rooms
  • sprites
  • player.js
  • script.js
  • style.css
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
  </head>
  <body scroll="no" style='overflow:hidden' id='body'>
    <img id='pStanding'src = 'sprites/frontward.png' style = 'display:none;'>
    <img id='pStandingLeft'src = 'sprites/frontwardLeft.png' style = 'display:none;'>
    <img id='walk1Right'src = 'sprites/one.png' style = 'display:none;'>
    <img id='walk2Right'src = 'sprites/two.png' style = 'display:none;'>
    <img id='walk3Right'src = 'sprites/three.png' style = 'display:none;'>
    <img id='walk4Right'src = 'sprites/four.png' style = 'display:none;'>
    <img id='walk5Right'src = 'sprites/five.png' style = 'display:none;'>
    <img id='walk6Right'src = 'sprites/six.png' style = 'display:none;'>
    <img id='bank'src = 'sprites/bank1.jpg' style = 'display:none;'>





    <img id='walk1Left'src = 'sprites/oneLeft.png' style = 'display:none;'>
    <img id='walk2Left'src = 'sprites/twoLeft.png' style = 'display:none;'>
    <img id='walk3Left'src = 'sprites/threeLeft.png' style = 'display:none;'>
    <img id='walk4Left'src = 'sprites/fourLeft.png' style = 'display:none;'>
    <img id='walk5Left'src = 'sprites/fiveLeft.png' style = 'display:none;'>
    <img id='walk6Left'src = 'sprites/sixLeft.png' style = 'display:none;'>

    <img id='city'src = 'sprites/city.png' style = 'display:none;'>
    <img id='bill'src = 'sprites/bill.png' style = 'display:none;'>
    <img id='office1'src = 'sprites/office1.png' style = 'display:none;'>
    <img id='office2'src = 'sprites/office2.png' style = 'display:none;'>
    <img id='space'src = 'sprites/space.png' style = 'display:none;'>
    <img id='up'src = 'sprites/up.png' style = 'display:none;'>
    <img id='down'src = 'sprites/down.png' style = 'display:none;'>

    <img id='zeroworker'src = 'sprites/zeroworkers.png' style = 'display:none;'>
    <img id='oneworker'src = 'sprites/oneworker.png' style = 'display:none;'>
    <img id='twoworkers'src = 'sprites/twoworkers.png' style = 'display:none;'>
    <img id='threeworkers'src = 'sprites/threeworkers.png' style = 'display:none;'>
    <img id='fourworkers'src = 'sprites/fourworkers.png' style = 'display:none;'>
    <img id='fiveworkers'src = 'sprites/fiveworkers.png' style = 'display:none;'>
    <img id='sixworkers'src = 'sprites/sixworkers.png' style = 'display:none;'>




<p id='timer'>01:00:00</p>



    <button id='startButton' onclick='instructions()'>Start</button>
    <canvas id='canvas' height='590' width='1350'>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
    <script src="jscript.js"></script>
   <script src="player.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/2.7.0/fabric.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.7.1/brython.min.js"></script>
    
    <script src="rooms/room1.js"></script>
    <script src="rooms/room2.js"></script>
    <script src="rooms/room3.js"></script>
    
    <script>
      function workerss(){
  if(workers == 1){
      money += 1;
    }
    if(workers == 2){
      money += 2;
    }
    if(workers == 3){
      money += 3;
    }
    if(workers == 4){
      money += 4;
    }
    if(workers == 5){
      money += 5;
    }
    if(workers == 6){
      money += 6;
    }
}
    String.prototype.toHHMMSS = function () {
    var sec_num = parseInt(this, 10); // don't forget the second parm
    var hours = Math.floor(sec_num / 3600);
    var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
    var seconds = sec_num - (hours * 3600) - (minutes * 60);

    if (hours < 10) {
        hours = "0" + hours;
    }
    if (minutes < 10) {
        minutes = "0" + minutes;
    }
    if (seconds < 10) {
        seconds = "0" + seconds;
    }
    var time = hours + ':' + minutes + ':' + seconds;
    return time;
}

var count = '3600'; // it's 01:00:00

function start(){
    var counter = setInterval(timer, 1000);
}

function timer() {
    workerss();
    if (borrowing == true){
      var grand = parseInt(howMuch) * 0.00581666667;
      debt += grand;
    }
    if (parseInt(count) <= 0) {
        clearInterval(counter);
        gameOver();
        return;
    }
    var temp = count.toHHMMSS();
    count = (parseInt(count) - 1).toString();

    $('#timer').html(temp);
}
</script>
<script src="script.js"></script>
  </body>
</html>
result
console