A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: going into another room

  1. #1
    Banned
    Join Date
    May 2005
    Posts
    36

    going into another room

    i am making a rpg what i need is a script
    the idea is
    the player walkes across the screen and when he hits the end of the screen it goes to another room / area is there any way to do this without changing the frame if not a simple code to change the frame would be nice
    Any other ideas that would work post here

    Also i need hitdetecin for buildings and walls ect
    also i need a code for when the guy hits a door he goes into another frame for a shop bank woteva
    thanks

    peter.
    ----------

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    you will need to give more info on how the character is moving.

    As for hit detection on walls or else, you can use a simple hitTest method:

    this.onEnterFrame = function() {
    if (this.hitTest(_parent.wall)) {
    _parent.nextFrame();
    delete this.onEnterFrame;
    }
    };

    gparis

  3. #3
    Banned
    Join Date
    May 2005
    Posts
    36

    moving

    the player is moving by pressing the 4 arrow keys

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Try using the code i provided:

    give the player the instance name of 'player'
    give the wall the instance name of 'wall'

    Place a 2nd keyframe on the timeline. stop() actions on both 1st and 2nd keyframes.

    enter this code:
    Code:
    this.onEnterFrame = function() {
    if (player.hitTest(wall)) {
    this.nextFrame();
    delete this.onEnterFrame;
    }
    };
    gparis

  5. #5
    Banned
    Join Date
    May 2005
    Posts
    36

    ohhhhhhhhhh

    THANK YOU SOOOOOOOOOOOOOO MUCH I LOVE YOU *****************
    KISS
    KISS
    KISS
    YOU ARE THE BEST THANKYOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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