Making a blast from a bomb move another actor.

No one has been able to answer this question for me so I'm starting a discussion about it. I have it set so when you press down a bomb is spawned and when you let go the bomb is destoryed. I want to make it so when the bomb is destroyed, it gives off a blast to moves the actor opposite of where the bomb is placed. There is one video on how to make a blast but it's different and doesn't work. I need this to happen for everytime a bomb is spawn and destroyed. Can anyone help or make a demo for me?

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Is this the one you tried?

  • mahowardmahoward Member Posts: 15
    edited March 2014

    Yes that is the one. That video only shows how when a bomb is already pre placed in the scene and always does the same direction for the blast. It also only allows you to make an explosion once.

  • HopscotchHopscotch Member, PRO Posts: 2,782

    The essence of how the blast works should be the same. See if you can understand the individual elements and change them for your needs.

    For example, in the tutorial you only need to reset game.Blast back to 0 after the explosion to make it work a second time if you have more bombs on the screen.

    Other than that, the blast should work in all directions.

  • mahowardmahoward Member Posts: 15

    what would the attribute be if i made the change attribute game.blast = 0

  • HopscotchHopscotch Member, PRO Posts: 2,782

    All the bomb does, when it explodes, is set game.Blast=1. This tells the boxes that the bomb exploded and to react accordingly. After the explosion is over you would set game.Blast=0 again.

    This way, if a second bomb explodes, it can set game.Blast=1 again and the process repeats.

  • mahowardmahoward Member Posts: 15

    yeah but where would I put the game.blast=0 attribute?

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited March 2014

    When the bomb gets triggered,

    it should set game.blast=1, telling the game that it exploded

    turn the bomb transparent (because it exploded but needs to hang around for a bit)

    in a timer set to "after 0.2 seconds" (to give the boxes a chance to react), reset game.blast to 0 and then destroy the bomb.

  • mahowardmahoward Member Posts: 15

    would you mind making a demo?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Here is a quick variation on Tshirtbooths video tutorial. I have made a seperate controller for the touch, will give better control later on.

    Follow the game.Trigger and game.Blast attributes. This will show you when things get reset.

  • mahowardmahoward Member Posts: 15

    Thanks man. On mine while you hold the mouse button down the bomb grows. What would I add or change to make it so it stops at whatever size its let go on? You have it set at 50 by 50 I think after 1.5 seconds. Anyway to do what I said?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Doesn't it just blow up when you let go?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    Here is a simpler version, bomb grows to 70, explodes the second you let go.

Sign In or Register to comment.