The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 ViewsCan someone help me with this? I am having problems with a score system... I have been looking over many many tutorials found on google, and I found one that helped a little... So here is the script and everything
I have two frames, the first one is blank with some code setting the score var, the second frame has the character and the collectible, I have everything working right, except... If I add more then one collectible, the the copy does not work... Only the one I made first... Here is the script in the collectible
onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
_root.score += 1;
unloadMovie(this)
}
}
The code in the character is just some code to let him move by the arrow keys... So can anyone help me? Please, I am new to actionscript (almost) I have been using basic commands for animations like "stop();" But I am pretty much new to making games and stuff... But I look forward to uploading games to this site... Please help.
Sorry for double post, but I just found out if I change every collectibles instance name then it lets me pick them up and gives me my score =D but is there a better way to do this then having to give each one a different instance name?
Try:
onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
_root.score += 1;
this._visible=false;
}
} :'(
That only makes the MC go invisible and my score just keeps going up, I got to 100 score in about, three seconds.... Plus when I added more, it made the one I made first go invisible and it deleted the other ones =/...
then do the work around, set it's _x and _y to WAY off screen.
"Give a man a match, and he'll be warm for a minute, but set him on fire, and he'll be warm for the rest of his life."
At 12/11/08 12:52 PM, ssjskipp wrote: then do the work around, set it's _x and _y to WAY off screen.
No.
onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
_root.score += 1;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
} Hmm, that did not work either =(... It did do this weird thing where, I could not collect the copy until I collected the first one... And I had to collect the first one two times which gave me a score of 3 after collecting all of them...
At 12/11/08 01:10 PM, UnknownFury wrote:At 12/11/08 12:52 PM, ssjskipp wrote: then do the work around, set it's _x and _y to WAY off screen.No.
onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
_root.score += 1;
this.swapDepths(_root.getNextHighestDept h());
this.removeMovieClip();
}
Close, but my guess is _root isn't going to cut it. Try:
onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
_root.score += 1;
this.swapDepths(_parent.getNextHighestDepth());
_parent.removeMovieClip(this);
} "Give a man a match, and he'll be warm for a minute, but set him on fire, and he'll be warm for the rest of his life."
you will need to use an an array with attach movie or duplicate :)