sdf
This commit is contained in:
parent
ece4540426
commit
4c31674539
4
main.zig
4
main.zig
@ -82,9 +82,9 @@ fn draw() !void {
|
||||
// mv_axis_border_bounce(w, &primitive.vec.b, 'x');
|
||||
// mv_axis_border_bounce(w, &primitive.vec.b, 'y');
|
||||
// mv_axis_border_bounce(w, &primitive.vec.c, 'x');
|
||||
// mv_axis_border_bounce(w, &primitive.vec.c, 'y');
|
||||
mv_axis_border_bounce(w, &polygon.head.?.point, 'Y');
|
||||
try primitive.polygon_draw(buffer, w, &polygon);
|
||||
try fill_draw(w, buffer);
|
||||
// try fill_draw(w, buffer);
|
||||
try out.print("{s}", .{buffer});
|
||||
|
||||
sleep(30000000);
|
||||
|
@ -23,20 +23,20 @@ pub fn mv_axis_border_bounce(w: Winsize, point: *Point, axis: u8) void {
|
||||
cor = &point.x;
|
||||
upper = w.ws_col;
|
||||
dir = &point.direction.x;
|
||||
dir.* = -1;
|
||||
dir.* *= -1;
|
||||
},
|
||||
'Y' => {
|
||||
cor = &point.y;
|
||||
upper = w.ws_row;
|
||||
dir = &point.direction.y;
|
||||
dir.* = -1;
|
||||
dir.* *= -1;
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
||||
if (cor.* < upper and cor.* > 0) {
|
||||
//if (cor.* < upper and cor.* > 0) {
|
||||
cor.* += dir.*;
|
||||
}
|
||||
// }
|
||||
if (cor.* >= upper or cor.* <= 0) {
|
||||
dir.* *= -1;
|
||||
cor.* += dir.*;
|
||||
|
Loading…
Reference in New Issue
Block a user