A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: hw shooter(so far)

  1. #1
    I'll Set You On FIRE
    Join Date
    Dec 2004
    Location
    Earth
    Posts
    15

    hw shooter(so far)

    I have been for a small while been working on a game called homework shooter... it is attached to this post... that is what I have so far and it works very reliably. I am trying to make it have different sounds and different "exploded"-type messages. I am using the math.random() function to achieve this...I know this may be a noobish question but is there a way to get this code:
    Code:
    _root.sight.gotoAndPlay(numb);
    refering to a movie clip, to reconsider this code:
    Code:
    num=math.round(math.random()*5);
    if(num=0){
    	numb=2
    }
    if(num=1){
    	numb=5
    }
    if(num=2){
    	numb=11
    }
    if(num=3){
    	numb=14
    }
    if(num=4){
    	numb=17
    }
    if(num=5){
    	numb=8
    }
    constantly so that each time you click it comes up with a new message thing...?

    ok... thanks in advance to anyone that can help me out with this...

    Don't Get Deported,
    Eric
    Attached Files Attached Files
    -=*MY FOOTER IS NOT TOO DAMN BIG*=-
    If a tree falls, and no one is there to hear it, does anyone care?
    My cat could kick your dog's ass!

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    Try this:
    code:
    sounds = ["snd1","gfire","bloom","ups","bing","snd2"];
    fr = [2,5,11,14,17,8]
    mySound = new Sound();
    btn.onPress = function(){
    num = random(6);
    mc.attachSound(sounds[num]);
    if (_root.target_mc.hitTest(_xmouse, _ymouse, false)){
    _root.sight.gotoAndPlay(fr[num]);
    }
    }


  3. #3
    I'll Set You On FIRE
    Join Date
    Dec 2004
    Location
    Earth
    Posts
    15

    thanks

    thanks for that...!
    that solves individual sound problem...

    1 more thing

    if I have a movie clip, that start with crosshairs... and when you shoot(click) it moves to a frame of "exploded" and playes a sound of me saying "exploded"..

    is there a way where i can randomize the sound and clip frame to go to but still keep them togather .. so when a message like "imploded comes up randomly out of 6 the sounf "imploded" will be with it... I hope this give you a good enough description... If you need more info i would be happy to provide thr .fla!

    thanks for the sound code...

    Don't Get Deported,
    Eric
    -=*MY FOOTER IS NOT TOO DAMN BIG*=-
    If a tree falls, and no one is there to hear it, does anyone care?
    My cat could kick your dog's ass!

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    This code solves all your problems, - sounds and frames as well. You can post your fla up here and I'll correct it.

  5. #5
    I'll Set You On FIRE
    Join Date
    Dec 2004
    Location
    Earth
    Posts
    15

    sorry

    Thank you so much...

    I'm sooo sorry for not updateing sooner... i was on vacation,
    anyway... I'm having problems uploading the fla and/or zip,
    so as soon as I can fix that crap ill have it up here or ill find another host and ive ya a link!!
    thanks again!!

    Don't Get Deported,
    Eric
    -=*MY FOOTER IS NOT TOO DAMN BIG*=-
    If a tree falls, and no one is there to hear it, does anyone care?
    My cat could kick your dog's ass!

  6. #6
    Senior Member sharma's Avatar
    Join Date
    Oct 2004
    Location
    Canadia
    Posts
    1,017
    what the hell's a motion tween?

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