A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [mx04]

  1. #1
    Member
    Join Date
    May 2008
    Posts
    48

    resolved [mx04]

    i am making a game that your indiana jones and you go though obsticles
    and stuff and everthings gone fine except for when it comes to hitting the
    enemy. its supposed to go like this: if you hit the enemy, you go to
    were you started from (begining) but the code i tried to make didint work

    onClipEvent (load) {
    reset = this._x=-172.1;
    this._y=-235.9;
    }
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.player)) {
    _root.player.reset;
    }
    }


    can some one please help

    oh and sorry i couldn't post the game for you to see it. because i don't now how.sorry
    Last edited by askentoyou; 06-24-2008 at 07:06 PM.

  2. #2
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    Try:

    Code:
    onClipEvent (load) {
    reset = this._x=-172.1;
    this._y=-235.9;
    }
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.player)) {
    _root.player._x = reset;
    }
    }
    If this doesn't work, try to use the trace statement to find possible errors.

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