Scoring?

thor6577

  • Posts: 189
Can someone post a screenshot of the scoring behavior that continues throughout a game?

Darkhog

  • Posts: 1243
You just need to keep score as game attribute.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

thor6577

  • Posts: 189
Can u post a screenshotof the behavior because this is what i have so far. (Sry for confusion i know what an attibute is )

« Last Edit: July 28, 2011, 09:05:46 am by thor6577 »

Alexin

  • *
  • Posts: 3132
Learn about Game Attributes.
"Find the fun"
alexin@stencyl.com

Sunflower

  • Posts: 591
1. Go to Game Center.
2. Find "Game Settings" menu.
3. Find there "Attributes" tab and enter it.
4. Click on "Create New" button (which is on the right, just below the tabs bar, where Game Center tab is). Before that, you may want to check out "What are Game Attributes" buttons, which says that:
Quote
Game Attributes are global, persistent values that are suitable for tracking high scores, statistics and game save data.
5. Name it as "Score" and set as "Number".
6. Enter any behavior.
7. Enter "Palette >> Attributes >> Global Attributes".
There are blocks for getting and changing global attributes. Note that value of this attribute is kept between levels!

thor6577

  • Posts: 189
Ok this is what i have so far is that correct? BTW. I am making a game based on the run and gun game what behavior what behavior would i do this part in stencylpedia for adding +50 points evry time you kill and enemy?

coleislazy

  • *
  • Posts: 2607
The game attribute "score" (the purple block) and the behavior attribute "score" (the blue block) are different things. You need to delete the attribute in the behavior and just use the purple game attribute block. You also need to replace the increment block with a block that is something like "set score to [[score] + [Points to Add]]".

thor6577

  • Posts: 189
Like this? And if it is all i have to to is follow intructions for showing the score using draw text right?

Sunflower

  • Posts: 591
Yes, block for setting score, as well as drawing it seems correct, though you need to use violet (Game Attribute) block in "Add Score" thingy, rather than blue (behavior Attribute) one.

Though now that I think of it "when created" block worries me. I'm just not sure if you want the score to be restarted every time scene begins. But if you want that, I think that's fine, then. O.o

thor6577

  • Posts: 189
Where should i put the Set Score to [number] block? In always?

coleislazy

  • *
  • Posts: 2607
You only have to set it to zero when you want to reset the score. It will be zero by default when the game starts. The point of havig a game attribute is that it won't get reset between scenes, it is available to all behaviors, and can be saved.

thor6577

  • Posts: 189
Ok, i tested it but its not adding the score. Why is this?

« Last Edit: July 28, 2011, 11:09:18 am by thor6577 »

coleislazy

  • *
  • Posts: 2607
Did you put the green block to add to the score in another behavior somewhere? It doesn't know when to add the score until you tell it to.

thor6577

  • Posts: 189
I couldnt find the green block. Where can i find it ?

coleislazy

  • *
  • Posts: 2607
Its under the "custom" category.