Light beam
joelloyd
Member, PRO Posts: 119
I'm looking for a way to create a light beam, anyone know of any tutorials, iv looked and can't see any, or a way to do it. Thanks
Comments
Can you show a sample of exactly what you want/mean by light beam?
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
You mean like this?
The actor for the laser is big enough so as to not show up even on full screen. When they spawn, they are constrained in relation to a game.attribute on the main actor, they use an interpolate behavior for their height to expand, or a timer/fake timer that adds to their size every 0.06 seconds until they reach a certain height.
It's a bit complicated and there are many ways to do it. Others on here can probably do the same thing with much less code than mines.
Sometimes interpolating actors don't detect collisions.
I would do that beam with animation. Or maybe changing size.
@Franto That's some cool stuff. That's done in GS?
@gattoman My mistake, I think it only uses interpolate to shrink, but for expanding upon spawning, it uses the fake timer "mod1" rule, repeating a change attribute every 0.06 seconds to add pixels to its size until it reaches the size limit condition, once it reaches that limit, a constrain keeps it from getting bigger. I got the "mod1" fake timer rule from the thread on timer alternatives by socks.
That would explain why it still deals damage when it appears and causes enemies to explode instead of not detecting the collision. I DID find that an actor with "movable" attribute checked off would not detect the collision from the big "laser" type attacks. In fact, I'm gonna make a thread about that now.
EDIT: I'm not sure, but I think the 2nd laser type with the widest beam uses interpolates, but I do remember that actors stuck on unmovable won't detect collision from it.
To fix something I said, I meant the laser's actor is bigger than the screen width, so as the edge of it can't be seen even if the actor is all the way to the edge, lol.
@ookami007 Yes, definately GS. GS is capable of a lot of awesome things.
Very good explanation. Thanks Franto. I will mark and remember that.
This exactly what I want, I don't want the beam to expand, but the beam will stop at some actors. Being spawn from one to the next. Is this possible? Thanks so far