Copy link to clipboard
Copied
Anyone knows why am I getting this error? All brackets are closed.
if (s_score(value:Number) < 10000)
Copy link to clipboard
Copied
you have a syntax error.
use:
if (s_score(value) < 10000)
Copy link to clipboard
Copied
Thanks, I tried, but then I got error 1180 and 1120. I'm actually using the tutorial from Scores, HUDs, and User Interface | Flash Game Development Tutorials - As Gamer to create my own version of shooting game (there is a download link for the whole game, including a few more as files). The tutorial comes with 1 enemy (Stinger) and 1 level, it also comes with a score system, so I'm trying to create more enemies (Stinger 2 and 3) and levels. I'm able to add more enemies to the array, and want to make them only spawn between specific scores. Here's the original game engine.as coding:
And here's the original scoreHUD.as coding:
I've made changes to the game engine.as but not the scoreHUD.as, here's my version:
In my version, line 44 - 63 is the enemies spawn control, I added line 40, 41, 64 so these enemies only spawn when player's score is below 10000, I was going to set another wave of enemies for 10001 - 20000 to increase the difficulty, but obviously I have to fix these errors first.
Copy link to clipboard
Copied
your original question is answered. this thread should be closed. that you have more errors is not related to your original question.
once a compiler error is corrected, further errors may be discovered by the compiler. you may have many errors even beyond the additional two you posted.
so you need a method to correct your errors, or in computer parlance, to debug your code.
with actionscript in animate/flash pro, start by clicking file>publish settings>swf and tick 'permit debugging'. retest.
the problematic line numbers with their errors will be in the error message allowing you quickly find your error and correct it. if you need help correcting the error(s), you can post in the adobe forums and ask for help.
but don't post 87 lines of code and ask us to debug it. pinpoint the problematic code like you did in your first message.
(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now