💎🚋 Checkpoint
./data.js:9517054/103 ./script.js:9517054/1195
This commit is contained in:
parent
3d1d465fcd
commit
c8a8277dca
2 changed files with 12 additions and 2 deletions
2
data.js
2
data.js
|
@ -17,7 +17,6 @@ window.game = {
|
|||
],
|
||||
camera: [200, 100],
|
||||
size: [0, 0],
|
||||
zoom: 1, // buggy and should really not be used
|
||||
player: {
|
||||
x: 200,
|
||||
y: 0,
|
||||
|
@ -35,6 +34,7 @@ window.game = {
|
|||
color: {
|
||||
player: "red",
|
||||
platforms: "#222222",
|
||||
shadow: "#333333",
|
||||
background: "white",
|
||||
dots: "#f6f6f6",
|
||||
}
|
||||
|
|
12
script.js
12
script.js
|
@ -51,11 +51,21 @@ function draw() {
|
|||
}
|
||||
|
||||
// draw platforms
|
||||
ctx.fillStyle = c.platforms;
|
||||
// ctx.fillStyle = c.platforms;
|
||||
// for (let part of parts()) {
|
||||
// ctx.fillRect(part[0] - offx, part[1] - offy, part[2], part[3]);
|
||||
// }
|
||||
|
||||
for (let part of parts()) {
|
||||
ctx.fillStyle = c.shadow;
|
||||
ctx.fillRect(part[0] - offx - 2, part[1] - offy + 2, part[2], part[3]);
|
||||
ctx.fillRect(part[0] - offx - 2, part[1] - offy + 2, part[2], part[3]);
|
||||
ctx.fillRect(part[0] - offx - 1, part[1] - offy + 1, part[2], part[3]);
|
||||
ctx.fillStyle = c.platforms;
|
||||
ctx.fillRect(part[0] - offx, part[1] - offy, part[2], part[3]);
|
||||
}
|
||||
|
||||
|
||||
// draw player
|
||||
ctx.fillStyle = c.player;
|
||||
ctx.fillRect(
|
||||
|
|
Loading…
Reference in a new issue