2d light beam

Get help using Construct 2

Post » Fri Dec 28, 2012 2:44 pm

Hello,

I want to accomplish a typical 2D light beam:



I want to move the light beam when the game progresses, so I want it to be 1 "solid" (not behavior) object. I could accomplish this with about 13 round sprites of this example:

http://www.scirra.com/arcade/addicting-example-games/16/html5-lighting

But when I try to move the object type Light, which contains all of these round sprites. It move all instances to the same exact position, but I want to keep the form of the lightbeam as it is.

Can someone help me to move the whole object type or tell me a better way to create a 2d light beam?

thanks!Astrosus2012-12-28 16:05:49
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Fri Dec 28, 2012 3:16 pm

Post a .capx
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Fri Dec 28, 2012 4:05 pm

Here:

Lightbeam.capx

As you can see, it sets the position of all instances to the X and Y value. I want to move the object type as a whole, so the form of the light beam stays as it is.
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Fri Dec 28, 2012 4:34 pm

If you are going to continue with this grouping, you have to move all LIGHT objects relative to their initial position.
Try: Set X to self.X-25 and Set Y to self.Y-20blackhornet2012-12-28 16:34:51
ImageImageImage
B
67
S
19
G
123
Posts: 3,213
Reputation: 73,913

Post » Fri Dec 28, 2012 4:41 pm

This works, but I want to set the light beam underneath another object like in the picture of my first post.

So what to use instead of:



thanks for your help!Astrosus2012-12-28 16:44:00
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Fri Dec 28, 2012 5:00 pm

The easiest thing would be to build up what you did in C2 in a graphics editor and make one sprite. Otherwise, you are stuck doing a bunch of math to move the group around relative to each other and the scene.
ImageImageImage
B
67
S
19
G
123
Posts: 3,213
Reputation: 73,913

Post » Fri Dec 28, 2012 5:38 pm

Yeah, but I am not an artist and I can not accomplish this bloomy light graphic.
B
8
S
2
Posts: 110
Reputation: 1,463

Post » Fri Dec 28, 2012 6:24 pm

Pin the beams to another sprite and move that. lightbeam2 (r114)
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Dec 28, 2012 6:32 pm

Thanks, it works great. So simple, I need to get used to to the simple creation of games after I tortured myself through the 3D game development
B
8
S
2
Posts: 110
Reputation: 1,463


Return to How do I....?

Who is online

Users browsing this forum: emoticon, KeetonCat, makkancs, Matthew de and 27 guests