Need a growing Laser?

beefy_clyrobeefy_clyro Member Posts: 5,394
edited November -1 in Working with GS (Mac)
Hey. Im having a little trouble figuring out how i would do this. Basically i have an actor that can move around in a big square, i want to be able to fire a laser which grows in size from the actor until it hits something, whether it be something in the square or the squares walls/edges.

Any ideas greatly welcomed and appreciated.

Comments

  • wormilwormil Member Posts: 127
    IIRC, changing an actors size leaves the original hitbox, correct?
  • RedlerTechRedlerTech Member Posts: 1,583
    Look on the power bar, it should give you a basic idea.

    If I wanted a laser to come out of a gun, I would do something like
    Interpolate self.size.width to 50
    Constrain self position x to (gunX +( gunWidth/2))+(laserwidth/2)

    I'm a little confused about what exactly you want. You may want to do this.

    Self Boolean - collided (false)

    If collides, change self.collided to true

    Every .3 seconds,
    If collided is false,
    interpolate self.size.width with a duration of .3

    Matt
    http://matthewredler.com

    Make sure the duration and timer are the same.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Imagine you are in a square that is 200 tall. If you are at the bottom on 0, i would need the size of that beam to go from the gun to the top of the square (200). Now if something moves in front of the laser at say 150 from the bottom, the laser needs to hit it and change its size to that. If the gun moves up to say 100, the laser needs to go from there till the next point it collides. so the laser should shoot 1 solid beam, it constrains to the gun and continues on growing in size till it hits something and then adjusts its size to that.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Oh good. I thought from the title of this thread that this was more spam for Viagra.

    beefy, maybe try some reverse technology on the tutorial for the health bar from tshirtbooth? It's basically the same thing but in reverse…kinda.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    SlickZero said:
    Oh good. I thought from the title of this thread that this was more spam for Viagra.

    beefy, maybe try some reverse technology on the tutorial for the health bar from tshirtbooth? It's basically the same thing but in reverse…kinda.

    Haha yeh i can see how you may of thought that.

    I don't think that will work. The whole idea of changing its size based on a number is fine, but with health, you would start at say 100 and work down. The problem is, the 100 in this case will always need to be changing. If for instance you are close to the wall your laser may be as short as 20, if you are far away it maybe 200, if the laser is straight at say 200 but something comes in front, it needs to adapt to that.
  • LiquidGameworksLiquidGameworks Anchorage, AKMember, Sous Chef Posts: 956
    Maybe check out GS connect template. Seems to achieve a similar result.

    @SlickZero My thoughts as well, but was thinking Space Balls...

    http://gamesalad.com/forums/topic.php?id=23688
Sign In or Register to comment.