A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Scrolling Top Down with Hit Test (Brute Force)

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Scrolling Top Down with Hit Test (Brute Force)

    Hi All,

    If I am posting a question that has been answers, I would greatly appreciate a link, because I cannot seem to find it exactly.

    So. I am designing a one level mini game where my character needs to walk around and be blocked by trees. Similar to pokemon/early FF type RPGs. I am hoping to do so using just brute force barrier testing and a v cam. Unfortunately the problem I am running into is while I can get the camera to scroll with the character, and I can get the character to be stopped by the tree, when I try to combine these functions the hit testing goes awry. It seems when the vcam moves the screen around, the stage continues to register the tree at it original position (and not where it has moved to). Help?

    I have put all the relevant pieces in a zip file attached. The problem is somewhere in the as files: HitTestPoint & CamFrame. I can also post the code here if people would like.

    Thanks!
    Attached Files Attached Files

  2. #2
    Bacon-wrapped closures Nialsh's Avatar
    Join Date
    Dec 2003
    Location
    Houston!
    Posts
    338
    At the end of HitTestPoint.as, I uncommented
    Code:
    			camera.x = player.x;
    			camera.y = player.y;
    and that seemed to fix it...

    I'm using CS5 if that means anything.

  3. #3
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    I haven't seen your file, and I don't think I will need to at this point anyway. But I want to tell you just in case you didn't know this, Vcam doesn't move around the stage or any objects, it just takes a snapshot of the area covered by it's movieclip(x/y, and width/height) and draws that on the stage above everything else. Hence all coordinates remain constant!
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

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