niteshmourya / app-inventor-for-android

Automatically exported from code.google.com/p/app-inventor-for-android
Apache License 2.0
1 stars 0 forks source link

2 errors in MoleMash2 tutorial #2201

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the "Registering touches" section, he tried to set the 
"ScoreValueLabel.Text" to show scores the player hit the mole in stead of 
"ScoreTextValue.Text". (In addition, there's no "ScoreValueLabel" but 
"ScoreTextLabel". If I were you, I won't named these two labels such confusing. 
Just use "ScoreText" and "ScoreValue".)

In the same section and same part, he tried to set this "ScoreValueLabel.Text" 
to cumulatively correct the scores by plus 1 every time player hit  the mole. 
The problem is "ScoreValueLabel.Text" don't seem to accept "number 1 + 
ScoreValueLabel.Text" due to different type of input. (number 1 is integer but 
"ScoreValueLabel.Text" is string.)

Strange but true, If you create a variable to handle the score before update it 
to ScoreValueLabel.Text, it's work. So the solution is...

1.Def Score as number 0 (Anywhere in your block editor)
2.In "When Mole.Touched do", set global Score to "global Score + number 1" 
before everything else.
3.Now, set ScoreValueLabel.Text to "global Score".
Leave the others as it is.

p.s. 
-As mention in the first paragraph, "ScoreValueLabel.Text" is a wrong label. 
You should replace what ever you renamed those two label with 
"ScoreValueLabel.Text" in other paragraphs.
-The second problem may used to work in previous version of AppInventor but not 
nowadays version.

Original issue reported on code.google.com by parasite...@gmail.com on 30 Jul 2012 at 2:28

GoogleCodeExporter commented 9 years ago
Thanks, I'll fix this as I move the tutorials to their new URL.

Original comment by mirre...@gmail.com on 30 Jul 2012 at 3:20

GoogleCodeExporter commented 9 years ago
I'm appreciated to hear that. Thanks.

On Mon, Jul 30, 2012 at 10:20 PM,
<app-inventor-for-android@googlecode.com>wrote:

Original comment by parasite...@gmail.com on 31 Jul 2012 at 2:58