Game Speed w/ Power Up Issue

motorcycle boymotorcycle boy Member Posts: 429
edited February 2015 in Working with GS (Mac)

So I want to alter the game speed when my character uses a power up. I figured that out no problem. I have a game level integer attribute I am using for my game speed. As a side note, my game speed is increasing by one integer every second. How can I get to the game speed that was the integer right before the power up was used? It's changing every second but doesn't need to change while the power up is firing. So for example, let's say my game speed is 80 and five seconds have gone by so that it is 85. This is also when the power up is used which will increase the game speed to 300 for five second. After the five seconds, game speed will resume at 85 and go up by one integer as usual. The problem is that since the game player will use a power up at any time during the game, I can't say change game speed to 85, or 100, or 261 etc since those numbers will not be what the were at when they hit the power up.

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Not sure that I understand you correctly...But couldn't you just record the speed (in a separate attribute) right before the power-up is used?

  • motorcycle boymotorcycle boy Member Posts: 429
    edited February 2015

    @Braydon_SFX I did think about that but I don't know how it would be done? I guess you would put in the rule in the power up to change table value to game.speed and write it in the table then have game speed change to that number when the power up is done. Is that what you mean or something similar to that?

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    I must not be understanding you correctly. The player uses the power-up whenever they want, right? So if, for example, they touch an actor to start the power-up, the first thing you do before your other power-up code is change game.PreviousSpeed to game.Speed.

    Does that make sense? Like I said, I am most likely misunderstanding you...

  • motorcycle boymotorcycle boy Member Posts: 429
    edited February 2015

    @Braydon_SFX yeah as long as they have the power up available, they can use it. Yup you are understanding correctly. Actually your first question got me thinking of a method so I just recorded the current game speed in a table, then fired off the coding for the power up and then loaded that value once the power up was finished and it worked perfectly.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Great! Glad you got it working!

  • motorcycle boymotorcycle boy Member Posts: 429

    Thanks man, some times I just need someone to push my thinking in the right direction :smiley:

Sign In or Register to comment.