#!/usr/bin/php5 = caca_get_canvas_width($canvas) || $x < 0 ) $x = 0; if ($y + caca_get_canvas_height($pig) - 1 >= caca_get_canvas_height($canvas) || $y < 0 ) $y = 0; caca_clear_canvas($canvas); // Draw caca_blit($canvas, $x, $y, $pig); caca_put_str($canvas, caca_get_canvas_width($canvas) / 2 - 10, caca_get_canvas_height($canvas) / 2, "Powered by libcaca ".caca_get_version()); caca_refresh_display($display); // Move cursor $x += $ix; $y += $iy; if ($x + caca_get_canvas_width($pig) >= caca_get_canvas_width($canvas) || $x < 0 ) $ix = -$ix; if ($y + caca_get_canvas_height($pig) >= caca_get_canvas_height($canvas) || $y < 0 ) $iy = -$iy; } ?>