Light source on projectiles?

Get help using Construct 2

Post » Wed Feb 27, 2013 9:56 pm

I made a new layer above the main game one, and made it black rather than transparent. Then created a new sprite on the same layer, which was just a white circle, set the blend mode to "Destination Out", and then made follow the player - That's how his lighting works.

The projectiles are sorta the same thing. Each time the mouse is clicked, it starts shooting bullets with a slight spread. So I made a smaller white circle on the "Lights" layer, set it to "Destination Out" and set an event for whenever a bullet was created, it would create this light ontop of it. This worked, but the light source stayed in a straight line while the bullets would veer off at different angles.

Then I made it so that every tick, the smaller light had it's position set to the bullet, and this worked. I don't know very much about programming at all so there might be a better way and it was a lot of trial and error but it works :)
B
3
Posts: 9
Reputation: 468

Post » Thu Feb 28, 2013 12:49 pm

Okay, so after getting this working last night, I load up the game this morning and it still works. Then I decide I want to add in a second fire mode for the main character - mainly just to see if I can - and attach a light source to that as well. This all works, only if you fire for longer than a second or two all the lights stop appearing. This happens on both attacks, and they won't re-enable until you fire the other attack after waiting a bit.

Is there a limit on how many sprites can be on screen at any given time? While they are super simple and don't cause any sort of performance hit, it's the only reason I can see for it to be doing this. Unless i've messed up something in my events log...which is probably just as likely really.
B
3
Posts: 9
Reputation: 468

Previous

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], WhosWho and 14 guests