score pb

Hello everyone,

I have a problem, i have two actors: one is an actor which is associated with the number 10,it change image when i click on, and the second is the score actor.

I have suceed to do, when i click on the actor 10, score increase by 10, and when i click again score actor decrease by ten. The problem is on the preview mode, score begins by -10.

I use only integer attribute equal to 0, and i don't have index attribute because i use windows.

actor configuration:
rule
when touch is presses
do: change attribute set attribute game.actor10 to 1-game.actor10

rule:
if game.actor10 =0
do: change image A
otherwise: change image B

Score configuration:
rule
if game.actor10 = 1
do: set game.score to set game.score +10
otherwise:set game.score to set game.score-10.

If you can help me, it could be wonderfull,

Comments

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375

    @vince92 said:

    do: set game.score to set game.score +10
    otherwise:set game.score to set game.score-10.

    Because the score attribute is 0 when it starts it is immediately changing the score to -10.

  • vince92vince92 Member Posts: 4

    Yes, i know but how to begin with a score equal to 0, and when i click on the 10 actor score will be ten, if i reclick on, score will be 0

  • vince92vince92 Member Posts: 4

    without to put the score attribute equal 10

Sign In or Register to comment.