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, 'x');
|
||||||
// mv_axis_border_bounce(w, &primitive.vec.b, 'y');
|
// 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, '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 primitive.polygon_draw(buffer, w, &polygon);
|
||||||
try fill_draw(w, buffer);
|
// try fill_draw(w, buffer);
|
||||||
try out.print("{s}", .{buffer});
|
try out.print("{s}", .{buffer});
|
||||||
|
|
||||||
sleep(30000000);
|
sleep(30000000);
|
||||||
|
@ -23,20 +23,20 @@ pub fn mv_axis_border_bounce(w: Winsize, point: *Point, axis: u8) void {
|
|||||||
cor = &point.x;
|
cor = &point.x;
|
||||||
upper = w.ws_col;
|
upper = w.ws_col;
|
||||||
dir = &point.direction.x;
|
dir = &point.direction.x;
|
||||||
dir.* = -1;
|
dir.* *= -1;
|
||||||
},
|
},
|
||||||
'Y' => {
|
'Y' => {
|
||||||
cor = &point.y;
|
cor = &point.y;
|
||||||
upper = w.ws_row;
|
upper = w.ws_row;
|
||||||
dir = &point.direction.y;
|
dir = &point.direction.y;
|
||||||
dir.* = -1;
|
dir.* *= -1;
|
||||||
},
|
},
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cor.* < upper and cor.* > 0) {
|
//if (cor.* < upper and cor.* > 0) {
|
||||||
cor.* += dir.*;
|
cor.* += dir.*;
|
||||||
}
|
// }
|
||||||
if (cor.* >= upper or cor.* <= 0) {
|
if (cor.* >= upper or cor.* <= 0) {
|
||||||
dir.* *= -1;
|
dir.* *= -1;
|
||||||
cor.* += dir.*;
|
cor.* += dir.*;
|
||||||
|
Loading…
Reference in New Issue
Block a user