A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Another Golf game in the make but some questions..

  1. #1
    Senior Member
    Join Date
    Feb 2000
    Posts
    226

    Post

    Hi,

    I’m working on this Golfgame but it is getting more and more complicated, I'm not at all an advanced Flash developer!

    I use real pictures and I got to the point that the 3D flight is working differently for club slection, fades and draws.

    At one stage in the movie, the ball is shot and moves with a curve to a new position that depends on the settings and the target the user goes for. There are certain positions with special effects when the ball ends up there. These positions are not rectangles, they are differently shaped, like for example a bunker.

    What would be the most efficient way to setup the actionscript for this? Preferably I would like the script to identify this occurrence as it happens and not by precalculating the new position as this would slow down the game!


    Btw. Another quick question about the getproperty x_, y_ position action for a movieclip. Am I right to belief that it gives the x, y positions of the ‘heart’ of the movieclip or is it top right, top left, etc.?

  2. #2

    Smile

    Hi raoul,

    As I've now done a bit of work on my own Flash golf game I might be able to help you.

    As I understand your question - your really asking about how to detect where the ball lands? Effectively this is a form of collision detection - ball colides with object (eg: bunker). There are few good articles on the web about collison detection - try colin moocks site www.moock.org.
    Really how this will work will depend on how you are tracking the ball movement and how you are displaying the view to the user (eg: top view or 3d view, or both)
    If you could put up a demo of your game so far or even a screenshot - I might be able to give some advice more specific to your scenario.

    regards David

  3. #3
    Senior Member
    Join Date
    Feb 2000
    Posts
    226

    Post

    Thanks david!

    I had a look on the moock site and I need to have a close look first but it seems he only deals with circles, squares and rectangles.

    For the flight of the ball I use a parabolic function in which certain settings are changed by club selection, strength of the shot and fade or draw. The top position is set by these variables as well and I let the parabolic function do the action. So I'm not exactly precalculating the final position!

    Probably I have to think in terms of x, y position of movieclips (make a movieclip in the shape of the bunker). But, so far I have no idea how I can have the action identify if the ball ends up within the boundaries of that movieclip?!

    This is basically how I set it up so far. When I thing it'is getting interesting I will certainly let you know!

    raoul

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