Skip to content

Commit

Permalink
add goal reached logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle committed Oct 14, 2024
1 parent 20f917b commit c666f67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions simulator/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ function step(pos: Point, uuid: string) {

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

if (dist <= 1) {
goals.delete(uuid);
return;
}

const speed = speeds.get(uuid) ?? 0.1;

if (Math.random() < 0.2) {
Expand Down

0 comments on commit c666f67

Please sign in to comment.