Score Keeping

From RTCwiki

Jump to: navigation, search

Contents

Topic Summary: In this topic you will learn how to add score keeping functionality to your game. Scoring uses variables, so you must learn about those first, then you will apply that learning to create a Scoring device for your game. You will also learn how to change a text field, so your score box can be updated as the score changes.


Topic Assignments

Complete the following tutorials to learn about Action Script Variables:


Learn how to add a simple score functionality to your game.

Watch this clip to see how add score keeping/counting to your game with Dynamic and Static Flash text:


  • There is a bit of code in this video that is not mentioned, and is too small to read. The entire script used is...
onClipEvent(enterFrame){
   if(_root.char.hitTest(this)){ 
      _root.money += 10;
      unloadMovie(this);
      }
    }

The unloadMovie(this) is very important. Otherwise the coin will stay in place and every single frame that the char is over it, the score will increasing by 10.


Update the Wiki

  • Upload the assets (.SWF and .FLA) you created to your Team page if you are working on a Team game, or to your "My Projects" page if you are working alone.


Update the Blog

  • Write a Blog post about this topic, share your learning experience!


Related Links and Tutorials


Search the Web for more information

Here are some search results on Flash ActionScript programming:


Image:Icons-mini-icon_user.gifImage:Icons-mini-icon_user.gifImage:Icons-mini-icon_user.gif Students Contributions

Personal tools