actionscript 3 - AS3 - Score counter -
i making simple math game 4 frames. in first frame can choose math operation want practice. in second frame presented randomly generated math question. if enter correct answer, application outputs "correct answer", , skips frame one. 1 point every correct answer. simplest way of keeping score, , output on screen?
to honest, answer pretty every question includes "...with ... frames..." asks simplest/best/sane way "without frames".
whenever switch frames, code on frame executed. if visit frame again, code executed again. if set score 0 on first frame, whenever go frame again, reset score 0.
the simplest way, far score goes, initialize once. according things mentioned above, means should never visit frame, sets score 0 again.
you can in 2 ways:
- split first frame 2 frames: both looking same, first 1 initialisation , whenever want "go frame 1", go second frame
- you don't use multiple frames: take content of each of frames , put own symbol (movieclip). instead of switching between frames, add/remove these movieclips display list.
i recommend 2, because better way of doing it. 1 simpler do.
Comments
Post a Comment