asdf
This commit is contained in:
parent
1e70d8cf96
commit
bca4b26dd7
@ -57,7 +57,7 @@ const Particle = struct {
|
||||
self.position.a.y = @floatFromInt(rl.getMouseY()-screenHeight/2);
|
||||
self.velocity.a.x = 0;
|
||||
self.velocity.a.y = -20;
|
||||
self.position.a.color.r = rand.intRangeAtMost(u8,0,255);
|
||||
self.position.a.color.r = rand.intRangeAtMost(u8,0,30);
|
||||
self.position.a.color.g = rand.intRangeAtMost(u8,0,255);
|
||||
self.position.a.color.b = rand.intRangeAtMost(u8,0,255);
|
||||
}
|
||||
@ -85,14 +85,14 @@ pub fn main() anyerror!void {
|
||||
var posx : i32 = 0;
|
||||
var posy : i32 = 0;
|
||||
|
||||
var p1 : [1000]Particle = undefined;
|
||||
var p1 : [5000]Particle = undefined;
|
||||
for (&p1) |*p| {
|
||||
xrnr = rand.float(f32);
|
||||
yrnr = rand.float(f32);
|
||||
p.* = Particle{.velocity = .{.a = .{.x = 1,.y = -3}},.acceleration = .{.a = .{.x=xrnr,.y=yrnr}}};
|
||||
}
|
||||
|
||||
const img : rl.Texture = rl.loadTexture("img.png");
|
||||
//const img : rl.Texture = rl.loadTexture("img.png");
|
||||
|
||||
rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window");
|
||||
defer rl.closeWindow(); // Close window and OpenGL context
|
||||
@ -138,7 +138,7 @@ pub fn main() anyerror!void {
|
||||
} else {
|
||||
posy = 0;
|
||||
}
|
||||
rl.drawCircle(posx,posy,5,rl.Color{.r=p.position.a.color.r,.g=p.position.a.color.g,.b=p.position.a.color.b,.a=255});
|
||||
rl.drawRectangle(posx,posy,5,5,rl.Color{.r=p.position.a.color.r,.g=p.position.a.color.g,.b=p.position.a.color.b,.a=255});
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user