Skip to content

Commit

Permalink
Update BubbleSystem.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBelmes committed Nov 14, 2023
1 parent ce53085 commit e3e4fd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/systems/BubbleSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { Vector3 } from "three";
const bubbleQuery = defineQuery([BubbleComponent])

let collectedtime = 0 //Assign out of system so scope persists
const tempvector = new Vector3(0,0,0)


export const BubbleSystem = defineSystem({
uuid: "BubbleSystem",
execute: () => {
const { elapsedSeconds, deltaSeconds } = getState(EngineState)
for (const entity of bubbleQuery()) {
const tempvector = new Vector3(0,0,0)
const bubbleComponent = getComponent(entity, BubbleComponent)
const localTransform = getMutableComponent(bubbleComponent.bubbleEntity!, LocalTransformComponent)
tempvector.addVectors(localTransform.position.value, bubbleComponent.direction.clone().multiplyScalar(bubbleComponent.speed))
Expand Down

0 comments on commit e3e4fd5

Please sign in to comment.