I am very new to script 3 in action and now I am trying to make a very basic game. However, no matter how many pages I look at, I cannot find a working way to get my game to keep score: /.
What I'm trying to do is make sure that 10 points are added every 10 seconds (now I replace it with a key to see if I can make it work, but he didn’t do it, t). This is the code I'm trying to use right now:
var playerScore:int = 0 stage.addEventListener(MouseEvent.CLICK,onclick); function updateTextFields():void{ playerScoreText.text = ("Player Score: " + playerScore); } if(Key.isDown(Key.G)){ playerScore++;
playerScoreText is the name of the dynamic text any help would be greatly appreciated :)
This code has been added to the timeline.
I think the problem is most likely related to the creation of dynamic text, but I'm not sure.
source share