💎🚋 Checkpoint

./data.js:9517054/103
./script.js:9517054/1195
This commit is contained in:
Glitch (glitch-hello-website) 2022-03-03 02:01:49 +00:00
parent 3d1d465fcd
commit c8a8277dca
2 changed files with 12 additions and 2 deletions

View file

@ -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",
}

View file

@ -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(