-
Help again please!
Well theres a game called stickicide and when you touch an object you die in a neat animated way and you respawn how would i do this heres the game just in case you dont understand what im saying
http://www.i-am-bored.com/bored_link.cfm?link_id=17442
i just need to know how to make it to where my character touches a certain object and the character dies in an animation like the game please give me answers thank you.
-
Here's what to do:
You need to create a movieclip for the "walls", next to that create another movieclip for the "touch-and-die" pieces.
on those pieces you add this code:
Actionscript Code:
onClipEvent(enterFrame){ if (_root.character.hitTest(this)){ _root.character.GotoAndPlay("dead"); } }
now in the characters movieclip you add a frame and call it "dead", from there you start animating the death.
don't forget to add the "stop" function.
good luck!
-
k
thanks mate if i have future problems ill tell you
-
No problem
if you have any questions, feel free to msg me ^_^.
All that shines, turns to rust.
-
um
heres what i am doing i made an enemy named it wall then i added a point and made it a movieclip named death point and i copy pasted your code to its actions then on my characters movie clip i opened it and made a new frame named dead and 5 frames for the death animation and added stop(); at the first frame of death sequence and the end of the death sequence but in game i touch it nothing happens please tell me step by step on what i should do thank you
-
make sure that the first frame of the death sequence is unreachable(unless the spikes you touch refer you to it)
simply said: make the first frame on the char movieclip have stop(); and name the second frame "death" (don't give it a stop action).
All that shines, turns to rust.
-
damn
damn um is it okay with you if i recorded me making the thing so you can see what im doing? im using flash cs4 would that have anything to do with it
-
Could be, i use Flash 8.
i could make you a quick example .fla if you want.
All that shines, turns to rust.
-
k
yes please also srry for late reply i had a football game
-
I made a example.But, how can I send files to you?
-
uh
mediafire upload it and give me link to download it cool part is tht no sign up is required to upload just upload fla file
-
sorry,my English is not good.I don't understand what you mean.
this is my code on scene1 frame1:
mc1_state = "normal";
function onEnterFrame() {
if (_root.mc2.hitTest(_root.mc1)) {
mc1_state = "die";
} else {
_root.mc2._x += 2;
}
if (mc1_state == "normal") {
_root.mc1.gotoAndStop(1);
} else if (mc1_state == "die") {
_root.mc1.gotoAndStop(2);
}
}
-
OK!this is the link!
http://www.mediafire.com/?iba714j201i13q7
any problem,tell me!
-
That seems to be working, saves me the trouble ^_^
All that shines, turns to rust.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|