Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch the block #2806

Merged
merged 13 commits into from
Feb 19, 2025
Prev Previous commit
Next Next commit
Update Sprig.js
hackclub-ethan authored Jan 27, 2025
commit b8c5814c87b12ba524c6060083fffb25bbb5d01f
9 changes: 3 additions & 6 deletions games/Sprig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
First time? Check out the tutorial game:
https://sprig.hackclub.com/gallery/getting_started

@title: Catch the block
@author: Ethan
@tags: []
@@ -93,7 +92,7 @@ setPushables({
})

function killFunc() {

if (getFirst(player).x == getFirst(kill).x && getFirst(player).y == getFirst(kill).y) {
loose = true;
for (let i = 0; i < 10; i++) {
@@ -159,7 +158,7 @@ afterInput(() => {
if (!loose) {
killFunc()
}

if (score >= 40) {
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10; j++) {
@@ -182,9 +181,7 @@ afterInput(() => {
getFirst(kill).x = getFirst(kill).x + 1;
} else if (playerPos[0] - killPos[0] < 0) {
getFirst(kill).x = getFirst(kill).x - 1;
}

if (playerPos[1] - killPos[1] > 0) {
} else if (playerPos[1] - killPos[1] > 0) {
getFirst(kill).y = getFirst(kill).y + 1;
} else if (playerPos[1] - killPos[1] < 0) {
getFirst(kill).y = getFirst(kill).y - 1;