TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Coding Trouble
Pages:
1
Coding Trouble
Yodigi7
Posts: 16
May 15, 2013, 03:24:04 pm
I have this piece of code (just the top part not drawing) that I am having trouble with. The score seems to increase at random increments from 100 to 400. I can't see anything wrong with it. (Score is a number game attribute with initial value of 0.)
~Tony
dtrungle
Posts: 1938
May 15, 2013, 03:38:02 pm
The event is finicky. Use a collision event where it increases the score and kills itself from there.
captaincomic
Posts: 6108
May 15, 2013, 03:40:58 pm
Sounds like the event is fired more than once. You can use a boolean to make sure the code is executed only once:
<if <not Done>>
<set Done to <true>>
<set Score to <Score + 100>>
Pages:
1