How to make an upgrade button?

Denisowator

  • Posts: 49
I need to make a button that will take away a score amount and increase the speed that the score goes up by. I want the button to be in the top right corner of the screen.

I know that it's gonna basically work by being clicked on and decreasing the score which is an attribute, then increasing the actor's speed as the score is increased by the actor moving.

Now here is what I can't do.
1. I don't know how to make it so that when you click on it, it does all that stuff.
2. (this one is a little off topic but, it's still related) I don't know how to make it so that when the character stops walking, the score and "amount ran" stops going up. I tried putting under the "if" block, an "otherwise", "otherwise if" and "repeat until" block but, nothing seems to work.

P.S. Please include screenshots in your replies as I am a beginner on Stencyl.

Thanks in advance. :)

Blue Bit Games

  • Posts: 104
If self is pressed decrease SCORE by 100 IF TRUE add 2 to speed.
This should be somewhat the coeing hope I helped.

Denisowator

  • Posts: 49
Thanks :).

Now I just have to figure out how to make the score counter stop going up when I'm not walking and how to make the upgrade button take more "score" away from you every time you click it.

Blue Bit Games

  • Posts: 104
Try
If walking add 100  to score if false add 0.

If self is pressed decrement score by 500

Denisowator

  • Posts: 49
Doesn't work. :(

It's as if Stencyl suddenly didn't understand it's own coding, because I join every possible block and line that would make logical sense to a human brain but, for Stencyl it's just either errors or it doesn't do what it should.

Blue Bit Games

  • Posts: 104
I'm not completely sure the if false part is correct.

sdieters

  • Posts: 2068
I'm not completely sure the if false part is correct.
nope it isnt.
Doesn't work. :(

It's as if Stencyl suddenly didn't understand it's own coding, because I join every possible block and line that would make logical sense to a human brain but, for Stencyl it's just either errors or it doesn't do what it should.
its vica versa most of the time.
Stencyl ALWAYS knows what you want to do with a code, but he only gives you an error if you are telling him complete non-sense. for example if you tell him to do something like: add 10 points to (score attribute). but in this case you somehow overlooked the fact that you created (score attribute) as a text attribute, and thus he gives you an error, since you cant add 10 to a text. that is where he gives you an error.

anyway, i wil be back in about 30 minutes, then i will explain you how you can achive it =)
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p