This commit is contained in:
jonathan santis 2024-11-27 11:12:16 +01:00
parent 352cc7bcf5
commit 1f06051e0a
2 changed files with 2 additions and 0 deletions

View File

@ -124,6 +124,7 @@ const Emitter = struct
var posx : i32 = 0;
var posy : i32 = 0;
const att : Attractor = .{.vec = .{.a=.{.x=200,.y=200,.z=0}}};
const att2 : Attractor = .{.vec = .{.a=.{.x=400,.y=400,.z=0}}};
att.draw();
for (self.particles) |*p| {
@ -132,6 +133,7 @@ const Emitter = struct
p.update();
p.applyGravity(0);
p.applyForce(att.attract(p.*));
p.applyForce(att2.attract(p.*));
posx = @intFromFloat(screenWidth / 2 + p.position.a.x);
posy = @intFromFloat(screenHeight / 2 + p.position.a.y);

Binary file not shown.