Skip to content

Instantly share code, notes, and snippets.

@Kethku
Last active February 25, 2019 01:06
Show Gist options
  • Save Kethku/9a3d84aabcc0e13ad7f159d2f465da6f to your computer and use it in GitHub Desktop.
Save Kethku/9a3d84aabcc0e13ad7f159d2f465da6f to your computer and use it in GitHub Desktop.
SCRIPT-8
// title: Camera Bug
let x = 0;
let targetX = 100;
let t = 0;
let frequency = 150;
draw = () => {
clear();
camera();
print(0, 0, "x: " + x);
print(0, 8, "t: " + t);
if (t % frequency == 0) {
targetX = ((t / frequency) + 1) % 2 * 100;
}
x += (targetX - x) * 0.1;
camera(-x, 1);
sprite(0, 50, 0);
t += 1;
}
{
"lines": [
24,
0,
0,
0,
0,
0,
0,
0
]
}
{
"0": [
" ",
" 0 0 ",
" 00 ",
" 0 ",
" 0 00 ",
" 00 0 ",
" 0000 ",
" "
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment