Use angle instead of direction

This commit is contained in:
Andras Schmelczer 2023-05-20 11:45:11 +01:00
parent d3f66e2958
commit 6351a67703
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 19 additions and 16 deletions

View file

@ -18,7 +18,7 @@ export const spawnAgents = (canvasSize: vec2, agentCount: number): Array<Agent>
return {
position,
direction: vec2.fromValues(Math.cos(angle + Math.PI), Math.sin(angle + Math.PI)),
angle: angle + Math.PI,
species: 0,
timeToLive: Random.randomBetween(10, 15000),
};