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:

  1. split first frame 2 frames: both looking same, first 1 initialisation , whenever want "go frame 1", go second frame
  2. 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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -