A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Multiple levels/Interactive environment in a platform game

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    2

    Unhappy Multiple levels/Interactive environment in a platform game

    Hey all.... So i have a project due in for class VERY VERY soon and I know the code to this is very simple but i can't seem to figure it out -.-

    What i want is when 'player_mc' touches 'hitbox_mc' the movieclip 'bat_mc' will play and when it reaches its last frame it will be erased off the stage. (bat_mc will be stuck on first frame until 'hitbox_mc' is touched... )

    So pretty much when the character walks through an invisible box it activates a bat on the tree to fly away...


    Also

    I want something simular to the idea above, however when the character touches 'hitbox_mc' it will switch to 'room2' which is the next frame, here is the code so far

    Code:
    if(player_mc.hitTestPoint(hitbox_mc)){
              gotoAndStop("room2");
      
    }
    However the code above is giving me these errors:

    Code:
    Scene 1, Layer 'Actions', Frame 1, Line 284
    1067: Implicit coercion of a value of type flash.display:MovieClip to an unrelated type Number.
    
    Scene 1, Layer 'Actions', Frame 1, Line 284
    1136: Incorrect number of arguments.  Expected 2.
    I've attached a picture of what i'm trying to do..


    Help would be appreciated!
    Attached Images Attached Images

  2. #2
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    760
    Try using hitTestObject.
    [SIGPIC][/SIGPIC]

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