A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Action Script Help

  1. #1
    Member
    Join Date
    Aug 2005
    Location
    Canada, Ontario.
    Posts
    42

    Action Script Help

    Im creating a game, where you can move a person around on a tile map.
    The problem is, the person can go off the screen (map). I need an action script where the person can't go off the map. (hits a border).
    Thanks for the help, Tyler

  2. #2

  3. #3
    Member
    Join Date
    Aug 2005
    Location
    Canada, Ontario.
    Posts
    42

    Thanks

    Thanks dude

  4. #4
    Some dude, says hi Ultra Pulse's Avatar
    Join Date
    Jun 2005
    Posts
    262
    Nice use of links, you have to click the link to click another link!


    BTW you can use the hittest function.

    Code:
    onClipEvent(enterFrame){
    if(this.hitTest(_root.wall)){ // if it hits an object with the instance name wall
    this._y -= 1
    }
    }
    or you can use this code :
    Code:
    onClipEvent (enterFrame){
    if (this._x >= 550 //{ // width of movie
    this._x = 549;
    }
    if (this._x >= 0 //{ // ther side of the width of movie
    this._x = 1;
    }
    use the same code for up and down, I didn't test this code, but it should work,
    and you place it on the movie clip that you are controlling.
    Last edited by Ultra Pulse; 09-24-2005 at 04:30 PM. Reason: BLAH

  5. #5
    Member
    Join Date
    Aug 2005
    Location
    Canada, Ontario.
    Posts
    42

    THanks :S

    Thanks both pulses.

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