|
|
|||||
Topic, Please help! (Flash AS2) | ||||||
| ||||||
You must register or log in to post a message.So, yes, I think. For now I'm not actually working on ASCIIsnake, and I don't know if I will for a long time... just use a /*your mc name*/.swapDepth(/*parent of your mc*/.getNextHighestDepth()); right before you use the removeMovieClip(); onEnterFrame=function() { if(score>=target) play() } And the hittest (on the movieclip): if(name1.hitTest(name2)) { ++_root.score this.removeMovieClip //after ++_root.score } When create you "ASCIIsnake"? Or you dont create because you already created a game called "Path 4 Mouse"? So for example: score = 15; becomes... _root.score = 15; Maybe you knew that already, and maybe that's not the problem. [edit] @jp: i think that is what play does, must be another peice of code on another frame... Here's the .fla file. Before you ask, I didn't program the snake myself, but I plan to program everything else myself. Thanks for your help guys! Like so: onEnterFrame = function() { //do stuff } Here's my code now: I also tried it with a ; as well. Maybe it's because the code only checks once, and it should be constantly checking somehow. I'm stuck using mx04 (about F7) until I get some decent cash flow though, so really I have no clue if it works for f8+ That code would work in flash 8. It's a nice habit to use == and ;'s though. if (score == target) { one = tells flash to make one value equal to another two ='s tells flash to check if one variable is already equal to another When the snake eats some food, the score goes up by one. This code makes the score go to one anyway, and it doesn't play. Can anybody help? | Flash game developmentFirst post of the topicWhen the snake eats some food, the score goes up by one. This code makes the score go to one anyway, and it doesn't play. Can anybody help? |
I got to go to bed now though, even though I get th day off school tomorrow. It's midnight here...