Click to See Complete Forum and Search --> : luddite needs help with shooting game!
alexshazam
09-10-2008, 05:30 PM
Hi all, I was hoping someone could help me, I'm making a shooting game and want to be able to show damage in the areas the user has just pressed. For instance at the moment I have a movieclip which contains the an arm, I want to be able to click on the arm, and for that action to spawn a 'damage' movie clip at the point the arm was clicked. Is there any way to do this?
At the moment, I have lots of movieclips covering the arm, which when are hit show damage. This doesn't seem a very elegant option!
Please help if you can.
Thanks,
blanius
09-10-2008, 10:09 PM
make a movieclip called explosion or something that is an animation of the effect you want. in the last frame put some code that hides it by setting explosion._visible=false;
alexshazam
09-16-2008, 11:40 AM
Thanks, I wanted to be able to spawn multiple instances of the movieclip depending on where the mouse is pressed. Would something like this work at all for this purpose?
var Mode = "NewWhateverMc";
this.onMouseDown = function () {
if (Mode == "NewWhateverMc") {
var idName = "WhateverMc";
var depth = _root.getNextHighestDepth ();
var mcName = "WhateverMc" + depth;
_root.attachMovie (idName,mcName,depth,{_x:_xmouse, _y:_ymouse});
if (!Key.isDown (Key.SHIFT)) {
Mode = "SomethingElse";
}
}
};
newWhateverMcButton.onRelease = function () {
Mode = "NewWhateverMc";
};
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.