-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameLogic.js
41 lines (35 loc) · 854 Bytes
/
gameLogic.js
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
function drawContinents(canvas){
if(canvas.getContext){
var ctx = canvas.getContext('2d');
drawNorthAmerica(ctx);
drawSouthAmerica(ctx);
drawAfrica(ctx);
drawAsia(ctx);
drawAustralia(ctx);
drawEurope(ctx);
}
}
function drawNorthAmerica(ctx){
ctx.fillStyle="gold";
ctx.fillRect(10, 10, 150, 100);
}
function drawSouthAmerica(ctx){
ctx.fillStyle="goldenrod";
ctx.fillRect(10, 150, 100, 100);
}
function drawEurope(ctx){
ctx.fillStyle="blue";
ctx.fillRect(200, 10, 100, 100);
}
function drawAfrica(ctx) {
ctx.fillStyle="brown";
ctx.fillRect(200, 150, 100, 150);
}
function drawAsia(ctx){
ctx.fillStyle="lightgreen";
ctx.fillRect(300, 10, 200, 100);
}
function drawAustralia(ctx){
ctx.fillStyle="grey";
ctx.fillRect(400, 150, 100, 100);
}