Skip to content

Commit

Permalink
Add new player sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
s5bug committed Dec 5, 2024
1 parent 1bb6545 commit 8827a38
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
const characters: string[] = [
`
rr
rr
rrrrrr
rr
r r
r r
ggg
gyRy
RRR
gyyyg
RyyygR
g g
`,
`
l
Expand Down Expand Up @@ -118,7 +118,7 @@ llLLLl
let lastSpawnTick = 0
let x = 50
let vx = 1
let vx: 1 | -1 = 1
function update() {
if(!ticks) {
Expand All @@ -135,10 +135,10 @@ llLLLl
currentDelay = rateInterpolation()
// draw grass
color("green")
color("light_green")
rect(0, 80, 100, 20)
// draw pollution
color("yellow")
color("light_yellow")
rect(0, 80, 100, trashes.length)
color("black")
Expand Down Expand Up @@ -168,7 +168,9 @@ llLLLl
})
}
char("a", x, 78)
char("a", x, 78, {
mirror: { x: vx }
})
remove(trashes, trash => {
let ticksNeededToSpend: number;
Expand Down Expand Up @@ -236,7 +238,10 @@ llLLLl
})
if(currentlyCollecting === -1) {
if(input.isJustReleased) vx = -vx
if(input.isJustReleased) {
// @ts-ignore
vx = -vx
}
if(x >= 97) vx = -1
if(x <= 3) vx = 1
Expand Down

0 comments on commit 8827a38

Please sign in to comment.