A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: !!!NOT URGENT!!! Maze help

  1. #1

    !!!NOT URGENT!!! Maze help

    I really dislike the !!!URGENT HELP NEEDED!!! heehee so thought that I would throw in a joke.

    I am fairly new to Flash (ver5)

    I am creating a maze...got it all done everything works arrow keys move the cursor around, teh walls are all impenetrable (sic) but I want to put an event in that when they reach the end then they get a wav file plays and an option to restart.

    Thanks for teh basic help

    death.

  2. #2
    additional:

    there are MC for teh cursor as well as the end picture is also a MC.

  3. #3
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Well, for a clip to be the mouse cursor, place this code on it:

    Code:
    onClipEvent(load){
     Mouse.hide();
    }
    onClipEvent(enterFrame){
     _x = _parent._xmouse;
     _y = _parent._ymouse;
    }

  4. #4
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    For sound, do this to play a sound file from the library (make sure you right-click , and set a linkage name for it):

    Code:
    endSound = new Sound();
    endSound.attachSound("Put Linkage Name here");
    endSound.start();

  5. #5
    Thanks, I am still not getting it though.

    I do not need to hide teh cursor, (i know how to do this though from colouring pages I have made)

    I am not understanding the order of A.S. placement.

    I will explain further.

    I have a square cursor(I guess that is not the right name for it, in the code it is called "you") MC that is moved by the <>^v keys on the keypad.
    @ the end of the maze there is a MC (exit) and have the man set to go to frame 2 on exit(that works now)

    So where in here do I put the sound?

    (I copied this code from a DL'd available here, but changed the maze and such around.)
    -----start code-----

    on (keyPress "<Down>") {
    if (maze.hitTest(you._x, (you._y+5), true) ne "true") {
    setProperty ("you", _y, (getProperty(you, _y))+5);
    }
    if (exit.hitTest(you._x, you._y, true) eq "true") {
    gotoAndStop (2);
    }
    }
    on (keyPress "<Up>") {
    if (maze.hitTest(you._x, (you._y-5), true) ne "true") {
    setProperty ("you", _y, (getProperty(you, _y))-5);
    }
    }
    on (keyPress "<Left>") {
    if (maze.hitTest((you._x-5), you._y, true) ne "true") {
    setProperty ("you", _x, (getProperty(you, _x))-5);
    }
    }
    on (keyPress "<Right>") {
    if (maze.hitTest((you._x+5), you._y, true) ne "true") {
    setProperty ("you", _x, (getProperty(you, _x))+5);
    }
    }
    -----endcode------

  6. #6
    Junior Member
    Join Date
    Oct 2002
    Posts
    25
    on exit just gotoandplay some invisible mc which contains ur wav and at the end of the wav just put ur gotoandplay ("begin",2)
    What's the point of getting smarter in a world getting more stupid every moment ?

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