Skip to content

Commit c666f67

Browse files
committed
add goal reached logic
1 parent 20f917b commit c666f67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

simulator/app.ts

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ function step(pos: Point, uuid: string) {
6060

6161
const dist = Math.sqrt(Math.pow(diff.x, 2) + Math.pow(diff.x, 2));
6262

63+
if (dist <= 1) {
64+
goals.delete(uuid);
65+
return;
66+
}
67+
6368
const speed = speeds.get(uuid) ?? 0.1;
6469

6570
if (Math.random() < 0.2) {

0 commit comments

Comments
 (0)