A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [CS3] [AS2] Bending a ball

  1. #1
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034

    [CS3] [AS2] Bending a ball

    Hey chaps, long time no post... hows it going?

    I'm just getting back in to flash and wondered if anyone can help me?

    I'm trying to make a pelenty shoot out type game, but I'm struggling to actually make the ball move.

    Now without doing any complex 3D to 2D coding, I'm basically looking to have two variables.

    Power and Bend.

    So when a shot is taken the ball bends around like a Brazilian footballers kick (see this http://img72.imageshack.us/my.php?image=bendfo3.png as an example for what I mean).

    The simple way I've started to do it is set two text fields in the root, one for power, one for bend and a looping movie clip that sets the x and y position of the ball based on these two fields.

    The ball travels in a straight line, rather than bending.

    Any ideas as to how I can make a ball bend? I suppose I could animate it, but it would be great to just code it.

    Thanks in advance

  2. #2
    ....he's amazing!!! lesli_felix's Avatar
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    1,506
    Instead of power and bend, try forward and sideways velocity.

    Lots of forward, a small amount of side should give you a curved path.

    For a face-on viewpoint, you'll need some perspective equations too though, it depends how you want it to look.

  3. #3
    President PhobiK's Avatar
    Join Date
    Jan 2005
    Location
    Guatemala
    Posts
    918
    I can think of doing it like you would with gravity. Just making a variable, and set it, for example to 10, and then substract 1 in an onEnterFrame, so it would reduce and have a curve look.
    This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.

    This is my Blog!... The gaming Process
    Please check out my site: Giddel Creations

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