View Full Version : Jumping Question...
JohnnyTightLips
01-16-2007, 09:13 PM
I have a question -
Does anyone know the code I could use so that when my charcter jumps on someone's head like in Mario, that they die? What I mean is how do make his head and his body two different parts that interact differently?
For example: If you hit his side, you die. But if you jump on his head, he dies.
Does anyone know the code I can use to do this?
illini_trucker
01-26-2007, 03:23 PM
im not knowing the code specifics, but try this and code your own...
we'll use mario and goomba as an example
goomba should be a movieclip right and so is mario.. so something to this effect..
double-click on goomba_mc and find the x and y coordinates for example goomba's head where you want him to be squished is x=100 y=100
then, (again, my code not specific)
if mario_mc (this.goomba_mc._x and this.goomba_mc._y) {}
an inside the brackets what you want goomba_mc to do, i.e. squish flat, etc..
sorry, on my way to work, dont have exact codings, but is something to try
JohnnyTightLips
01-26-2007, 09:11 PM
Ok thanks, I will try this, but a quick question -
will I be able to select more points on the same goomba, so when you run into him on the side, you die?
barney_roo
01-28-2007, 06:55 PM
You need to make the head and the body different mc's, and add the hit test script you want to use to each of em...
Make sure dat the head is placed slightly further back than the head so that when you hit the side, you aren't hitting the head at the same time!!!!!!
Also make sure you put the same movement scripts on both head and body, so dat they look like they r movin together!
Hope this helps!!!
BaRnEy_RoO
JohnnyTightLips
02-04-2007, 02:27 AM
Thanks for the tip there, but how can I code it so that when I hit the head, all the appropriate MCs (the side of the body and head) do the animation, and not just the head?
E.g. I'm thinking if I jump on his head, only his head will flatten in my animation, as it is not a part of the same MC, and the side of the body will continue on.
JohnnyTightLips
02-13-2007, 09:25 PM
...
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.