Games with Bombs, How did you make the Bomb spread other actors apart?

VoidedSkyVoidedSky Member Posts: 1,095
edited November -1 in Working with GS (Mac)
Hi all, I have a game out, Bomb Extravaganza, and I am working on another game like it. In my game, I have a bunch of actors fly out from the bomb in random directions. If any of you have made games with bombs or something like it, how did you do the shrapnel?(make the surrounding actors spread apart)
Thanks!
~CowTechMan

Comments

  • VoidedSkyVoidedSky Member Posts: 1,095
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    you would need to use magnitude and vectorToAngle. Use magnitude to determine the distance between the blown-up actors and the bomb (have global attributes for the bomb's X & Y). Then use this value multiplied by a constant in an acceleration behavior within the blown up actors. Then use vectorToAngle (using those same global attributes) to determine the angle between the bomb and the blown up actors (you'll need the opposite angle, so + 180). How you spawn the bombs and so forth is up to you. But this should give the flying away from the exploding bomb effect.

    EDIT: What I said below would make it so the farther away from the bomb the farther you would fly away, which is obviously wrong. So You would to have a constant DIVIDED by the magnitude value. sorry

    EDIT: I meant above, not below! Sheeshh!
  • ORBZORBZ Member Posts: 1,304
    Here is an example that i whipped up:

    It doesn't use acceleration behaviors but instead directly manipulates the linear velocity of the scrap relative to where the blast occurred.

    It was done in about 20 mins.

    http://gamesalad.com/game/play/42622

    It is a shame that GameSalad doesn't consider Change Size a physics event.
  • JoshKahaneJoshKahane Member Posts: 470
    Pretty good timing this thread popped up just as I began experimenting with this. I took a look at your demo ORBZ and it doesn't react well to gravity. :) Any ideas as to how I could add gravity in without issues? It freezes.
  • VoidedSkyVoidedSky Member Posts: 1,095
    @ scitunes
    Will this still work with two bombs on the screen?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    In theory it should. You will need two game attributes (for X & Y) for each bomb. So that you can determine the speeds and angles for each explosion. Using acceleration should allow for multiple events like this and gravity should also work fine with this approach. I say this but I haven't tried it. What will not work is just spawning two instances of the same bomb, because they both will try to have their X and Y constrained to the same attributes which of course can't happen. So the more bombs you allow people to drop the more work there is going to be on your end of things.
  • ORBZORBZ Member Posts: 1,304
    Scitunes is correct. Use acceleration instead of direct x,y manipulation and gravity will work too.

    I'm on my iPhone now. I'll update the demo when I get back.
  • ORBZORBZ Member Posts: 1,304
    Ok, I updated the Blast Test.

    It now uses gravity.
  • JoshKahaneJoshKahane Member Posts: 470
    Thank you ORBZ thats really helpful.
  • VoidedSkyVoidedSky Member Posts: 1,095
    I would like to thank you all for all of your help! This solution has made my games a lot better! Thanks again!
    ~CTM
  • ORBZORBZ Member Posts: 1,304
    np, it was fun :) i updated the Blast Test with boundary walls and a height meter. Enjoy :)
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    ORBZ,

    I was just doing some research for a new game I'm working on and needed something just like this to figure out explosions. Just wanted to thank you again for the demo.
  • VoidedSkyVoidedSky Member Posts: 1,095
    Sorry to bring up an old post, but it beats starting a new one, but anyway, I can't get two explosions/bombs to work, I have Attributes for both, but, only the first bomb will work. Any ideas?
    Thanks
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    are the two bombs two completely unique actors? Do you have unique attributes for each?
  • VoidedSkyVoidedSky Member Posts: 1,095
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    good to know....might add shrapnel to my latest game...
  • ChirpinGamesChirpinGames Member, PRO Posts: 214
    Did anyone manage to get the 2 bombs working at once?
  • ChirpinGamesChirpinGames Member, PRO Posts: 214
    Hi Tshirtbooth,
    Thanks for pointing me in the right direction. I opened your "how to do a good blast" project and added 2 bombs onto the stage. I then created an actor to act as a trigger and made it set boom to 1 on press. For some reason it only works on one of the bombs though. It can't make them both go off at the same time. Any ideas?
    Cheers,
    Mark
  • ChirpinGamesChirpinGames Member, PRO Posts: 214
    Oh ok thanks mate i'll let you know how i go!
  • ChirpinGamesChirpinGames Member, PRO Posts: 214
    After a couple of hours i managed to achieve what i was after... thanks for the help tshirtbooth!
Sign In or Register to comment.