Use angle instead of direction
This commit is contained in:
parent
d3f66e2958
commit
6351a67703
5 changed files with 19 additions and 16 deletions
|
|
@ -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),
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue