;Balle V1.2 par aerith "aeris_vallee@hotmail.com" ;Pour une utilisation partiel ou complette dans un script me prevenir svp ;utilisation /balle alias balle { if (!$window(@balle)) window -Cdp +lt @balle -1 -1 400 300 var %b = 1 while (%b <= $1) { hadd -m balle.x %b $rand(50,350) hadd -m balle.y %b $rand(50,250) hadd -m balle.dx %b $rand(1,10) hadd -m balle.dy %b $rand(1,10) hadd -m balle.s %b $rand(1,10) hadd -m balle.c %b $rand(0,16777215) inc %b 1 } set %fps 0 set %fpsm 0 set %fpsc 0 .timerfps -o 0 1 fps .timerballe -mo 0 1 rballe $1 } alias -l rballe { drawrect -nrf @balle 16777215 1 0 20 400 300 var %b = 1, %a = $1 while (%b <= %a) { hadd balle.x %b $calc($hget(balle.x,%b) + $hget(balle.dx,%b)) hadd balle.y %b $calc($hget(balle.y,%b) + $hget(balle.dy,%b)) if ($hget(balle.x,%b) <= 10) || ($hget(balle.x,%b) >= 390) hadd balle.dx %b $calc(-1 * $hget(balle.dx,%b)) if ($hget(balle.y,%b) <= 40) || ($hget(balle.y,%b) >= 290) hadd balle.dy %b $calc(-1 * $hget(balle.dy,%b)) drawdot -nr @balle $hget(balle.c,%b) $hget(balle.s,%b) $hget(balle.x,%b) $hget(balle.y,%b) inc %b } drawpic @balle inc %fps 1 } alias -l fps { set %fpsm $round($calc((%fps + (%fpsm * (%fpsc - 1))) / %fpsc),0) drawrect -nrf @balle 16777215 1 0 00 400 20 drawtext -nr @balle 0 0 0 %fps fps, average %fpsm fps, time %fpsc secs set %fps 0 inc %fpsc 1 } on *:close:@balle: { .timerballe off .timerfps off hfree -w balle* unset %fps* }