How do I get Bombs to slow down when Hero Collides with Slow Power-Up?

Shadow_DevelopmentShadow_Development Rocklin, CA. United StatesMember Posts: 85
edited March 2014 in Tech Support

Hello GameSalad community, I hope your up to some question answering... :\ I am creating a "jump to kill" type game(similar to Mario) where you have to smash as many bombs as you can before more than 3 get to the other side, then it's game over. That's not my problem though, what I wish to achieve is that when the Player(Actor "A") collides with power up(Actor "B"), then the bombs(Actor "C") will slow down for a limited amount of time before the original speed is applied again.

What I know about my question:

1: There must be a timer placed in this problem.

Once again for further explaining, I want the bombs to slow down when the slow power-up collides with the player.


Thank you very much for your time, if you have any questions or need further explaining please don't hesitate to ask. Many thanks!

  • Shadow_Devlopment

Best Answer

  • quantumsheepquantumsheep Posts: 8,188
    Accepted Answer

    Is the spawn rule in a seperate actor to your actual Slow Power Up?

    Check that the rule is 'on'.
    Check where the power up is spawning (X/Y).

    Put a power up in your scene already so that you can grab it when the scene starts. This'll show if the rules work at least, and the spawning will be a seperate issue.

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    When you say slow down, do you want their movement to slow or do you want the frequency of their spawning to slow? Either way, explain what behavior you are using to move or what type of timer you are using to spawn?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Shadow_DevelopmentShadow_Development Rocklin, CA. United StatesMember Posts: 85
    edited March 2014

    Thanks for your comment @tatiang, I want the the actor's movement to slow down. In addition, I am using the "move" behavior on the bombs to move at a 0 degree angle ->. I am also using the timer behavior under the "blocks" section.

    @tatiang said:
    When you say slow down, do you want their movement to slow or do you want the frequency of their spawning to slow? Either way, explain what behavior you are using to move or what type of timer you are using to spawn?

  • quantumsheepquantumsheep Member Posts: 8,188
    edited March 2014

    Let's imagine you want your normal speed to be 90, and your slower speed to be 45.

    • Have an integer global variable called 'bomb speed' - set it to the slower speed (45)
    • Have an integer global variable called 'slowdown' - set it to 2

    In Actor A (your player) have a rule that says:

    • If collide with actor B change slowdown to 1
    • After 10 seconds change slowdown to 2

    In your bomb have a rule that says

      • Move
      • Move Speed set to bombspeed*slowdown

    What this will do is:

    Normal speed wants to be 90. So we make the bomb move at bombspeed (45) * slowdown (2) which = 90

    If the player picks up the slowdown power up, we change the slowdown variable to 1.

    So now you get the bomb moving at bomb speed (45) * slowdown (1) which =45

    You might ask why have the bombspeed variable at all? Why not just put in the value 45*bombspeed

    You can. I just find that I'm always tweaking values here and there. Having such a value as a variable means you can change the base speed of the bomb without having to go into any actors to find it - you just change the value in your variable list.

    Hope that helps,

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited March 2014

    I would make a game integer called speed set it to 100 (change this to suit) then simply have the enemies move at this speed and when the power up is collected change game.speed to 50.

    Darren.

  • Shadow_DevelopmentShadow_Development Rocklin, CA. United StatesMember Posts: 85
    edited March 2014

    I appreciate your help @quantumsheep however the screen glitches when I've tried your solution. I see random shapes flicker on and off on the preview screen. Is there a way to fix this? Thank you.

  • quantumsheepquantumsheep Member Posts: 8,188

    @Shadow_Development said:
    I appreciate your help quantumsheep however the screen glitches when I've tried your solution. I see random shapes flicker on and off on the preview screen. Is there a way to fix this? Thank you.

    That should not happen at all - it doesn't in any of the games I've used this in (four so far!) :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • Shadow_DevelopmentShadow_Development Rocklin, CA. United StatesMember Posts: 85

    @quantumsheep said:
    That should not happen at all - it doesn't in any of the games I've used this in (four so far!) :)

    Oh wait, I checked the actor spawner's physics and the "movable" was "checked". I unchecked it and it fixed the problem.

  • quantumsheepquantumsheep Member Posts: 8,188

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • Shadow_DevelopmentShadow_Development Rocklin, CA. United StatesMember Posts: 85

    I'm still very confused with this, nothing is working as planned. The slow power-up doesn't even spawn when I have:

    Timer: Every 5 sec.
    Spawn actor: Slow Power Up

    No actor is spawned. I wonder why? Am I going to have to open up a new question for this issue?

  • Shadow_DevelopmentShadow_Development Rocklin, CA. United StatesMember Posts: 85

    Many thanks to all the users who have contributed to this issue. Thanks again to @quantumsheep @DeepBlueApps and @tatiang for their assistance. My problem is solved. :D

Sign In or Register to comment.