Advancing slides scoring

I created a game that when you click items a score variable box adds. When the score = 1000 i want it to advance to slide 3. How do I program the score text box or my objects you click that if the total score is 1000 then it goes to another slide. Thank you.

Sounds like you have several events that could potentially get you to the 1000 mark.
That means you will have to do a point check with every object that is clicked.
You can tackle this more than one way.

Personally, I would use JavaScript to accomplish this.
I would create a function and place it as an onLoad event.
Then I would call the function with every click that generates points.

// function for checking points
window.checkPoints = function() {
    if (prez.variable("totalPoints") >= 1000) {
        prez.showSlideAt(3);
    }
}

On your objects you’ll need to add the points earned and then check

prez.variable("totalPoints",prez.variable("totalPoints")+100);
checkPoints();

If you prefer not to use the JavaScript - thats OK

On your object, you could also do standard actions.


The concept is the same.
Add your points and do the point check to move if you’ve reached 1000.

Hope this helps.

1 Like

Thank you! That worked! I really appreciate it.

2 Likes

Awesome to hear!
Thank you for the follow up.