A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: A ball that hits a slanted area (e.g. slope)

  1. #1
    Likes Pankakes
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    59

    A ball that hits a slanted area (e.g. slope)

    Hey guys, it's late and I want to know something. Here is what I'm trying to build:



    I hope I've done the math right...so now I could just calculate the angle at which it leaves again by knowing each of the velocity components and the angle of the slope. So technically I could make this work with a hittest. But I want to be able to get this angle without knowing the angle of the slope. Is there any way it can be programmed so it detects the angle at which the slope stands? This would make it much easier for me to just put the enture ground into one MC, rather than putting a bunch of different objects in one big MC, each having it's angles which I have to calculate first.

    Cheers,
    Chris

  2. #2
    Mr. GT4
    Join Date
    Jul 2008
    Location
    Seriously in the hills of Donegal, Ireland
    Posts
    3
    What if you used vectors at each point ie.
    point at top of the slope,
    point at bottom of slope on the ground,
    etc.

    Then you could use intersection of the line to detect when it has been hit? The image attached shows where the points would be.
    Attached Images Attached Images
    Last edited by E=X; 07-03-2008 at 09:38 PM.

  3. #3
    Likes Pankakes
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    59
    ah yes that sounds interesting...is there a vector class in flash? Unfortunately I didn't find any tutorial here on flashkit.

  4. #4
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Location
    Columbus, OH.
    Posts
    465
    I think this thread will be of some help, it's all about balls hitting arbitrarily oriented slopes.

    http://board.flashkit.com/board/showthread.php?t=741628

    There are some nice pictures zipped up towards the end of the thread (the big informative post, #3, won't make much sense without them).

    HTH

  5. #5
    Likes Pankakes
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    59
    thanks rachil, I'll have to take a closer look at it...I understand the concept...from the images only though. I have a hard time following your post, it's my english sorry .

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