/ * All Files Are Designed & Writen By Windy_SK, You Can Use IT Freely But ... You Must Keep this item! Email: seasonx@163.net*/
VAR Timer = NULL; var time_unit = 30; var a_speed = 10; var l_speed = 15; var move_x, move_y;
Function moveit () {var the_top = parseint (angle.style.top); var the_left = parseint; angle.style.top = THE_TOP MOVE_Y; Angle.Style.Left = THE_LEFT MOVE_X; IF (THE_TOP <0 || THE_TOP> Document.Body.offSetHeight) {angle.Rotation = 180 - Angle.Rotation; Move_Y = -Move_y; angle.style.top = the_top <0? 0: Document.body.offsetHeight Move_y; } IF (THE_LEFT <0 || THE_LEFT> Document.Body.OffSetWidth) {angle.Rotation = 360 - Angle.Rotation; Move_X = -Move_x; angle.style.Off = THE_LEFT <0? 0: Document.body.offSetWidth Move_x;}}}
Document.onkeyDown = function () {angle.Rotation = angle.Rotation% 360 if (Timer! = null) return; var the_angle = math.pi * angle.rotation / 180; switch (event.keycode) {Case 37: / / Left timer = setInterval ("angle.Rotation - = a_speed", time_unit); break; cas 39: // right Timer = setInterval ("angle.Rotation = a_speed", time_unit); Break; Case 40: // Down The_angle = Math.pi; Case 38: // Up Move_y = -math.floor (l_speed * math.cos (the_angle)); MOVE_X = Math.Floor (l_speed * math.sin (the_angle)); Timer = setInterval ("Moveit ()", time_Unit); Break;} return;} Document.onkeyup = function () {if (Timer! = Null) ClearInterVal (Timer); Timer = null;}
Window.onLoad = function () {setInterval ("Window.status = 'Rotation:' angle.Rotation '; Top:' angle.style.top '; Left:' angle.style.left", Time_Unit); }
Script>
head>