A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: keep the ball up game

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    168
    hi

    if anyone can help me out here, it would be much appreciated.
    I need to build a game that is just about the same as you can view here - http://spikything.com/games/kickups/

    Ive searched the movies section here for an fla that I could learn from but no luck.

    I have a swf of the same type of game but better motion (and addictive), that I could send to someone if they think they can help.

    All it is that Im basically looking for is when you click on the ball it needs to bounce in the air as though you were headering a soccer ball.
    I know Im probably asking for a lot here and trying my luck a bit, but if anyone has done this before and doesnt mind sharing their code with me, it would be appreciated

    thanks in advance

  2. #2
    godly++; jorosdaman's Avatar
    Join Date
    Jul 2001
    Location
    Albany, Western Australia
    Posts
    482
    thats a nice game there- would take a hell of a lot of angle finding though- difficult to make. i have, unfortunatly, never seen anything like it though, so i am afraid i cant help you with your cry for code.

    it wouldnt be to hard to do once you understand the basics of the engine which the game uses. have a look at the maths tutorials on flashkit- you should find at least one piece of useful infomation there.

    goodluck

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    168

    hmmm

    not sure about the exact code but, when the ball is clicked, do something like this:

    onClipEvent (enterFrame) {
    originalY = _y;
    originalX = _x;
    }
    onClipEvent (mouseDown) {
    mouseX = _root._xmouse-originalX;
    mouseY = originalY-_root._ymouse;
    radians = Math.atan2(mousex, mousey);
    degrees = radians*(180/Math.PI);
    }

    then you can find the angle of the mouse in relation to the center of the ball. then, move the ball in the opposite direction ie if the mouse was @ 180 degrees from the center, move the ball straight up. Then ask for some bounce code or make it up yourself.

    Hope I helped, Wavy.

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    168
    thanks for responding, I think I've managed to get a similar type of engine going

    thanks again

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