dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Need help for animation in typing game

Threaded View

  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    49

    Need help for animation in typing game

    Hello Seniors,

    I am posting this again and I hope I will get some guidance from you people. I am trying to develop a dynamic typing game. Below is the code I found from somewhere. It takes the movieclip on the stage from different directions. The problem with this code is that each time it brings the movieclip on the stage it changes its angle. I only need to bring the movieclip from different directions (I will put the text in these movieclips)


    onEnterFrame = function(){
    moveBox(box);}
    function moveBox(rotatetext){
    var speed:Number = 15;
    if (rotatetext._x >= Stage.width+15) {
    rotatetext._x = -10;
    rotatetext._rotation = Math.random()*360;
    }
    if (rotatetext._x <= -15) {
    rotatetext._x = 560;
    rotatetext._rotation = Math.random()*360;
    }
    if (rotatetext._y <-20) {
    rotatetext._y = Stage.height+20;
    rotatetext._rotation = Math.random()*360;
    }
    if (rotatetext._y >= Stage.height+15) {
    rotatetext._y = -15;
    rotatetext._rotation = Math.random()*360;
    }
    rotatetext._x += speed//* Math.sin(rotatetext._rotation*(Math.PI/180));
    rotatetext._y += speed//* Math.cos(rotatetext._rotation*(Math.PI/180));
    }
    Last edited by just_started; 11-28-2008 at 09:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center