att2
This commit is contained in:
parent
352cc7bcf5
commit
1f06051e0a
@ -124,6 +124,7 @@ const Emitter = struct
|
|||||||
var posx : i32 = 0;
|
var posx : i32 = 0;
|
||||||
var posy : i32 = 0;
|
var posy : i32 = 0;
|
||||||
const att : Attractor = .{.vec = .{.a=.{.x=200,.y=200,.z=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();
|
att.draw();
|
||||||
for (self.particles) |*p| {
|
for (self.particles) |*p| {
|
||||||
@ -132,6 +133,7 @@ const Emitter = struct
|
|||||||
p.update();
|
p.update();
|
||||||
p.applyGravity(0);
|
p.applyGravity(0);
|
||||||
p.applyForce(att.attract(p.*));
|
p.applyForce(att.attract(p.*));
|
||||||
|
p.applyForce(att2.attract(p.*));
|
||||||
|
|
||||||
posx = @intFromFloat(screenWidth / 2 + p.position.a.x);
|
posx = @intFromFloat(screenWidth / 2 + p.position.a.x);
|
||||||
posy = @intFromFloat(screenHeight / 2 + p.position.a.y);
|
posy = @intFromFloat(screenHeight / 2 + p.position.a.y);
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user