Puck's Forum Posts

  • Wow that's so simple it hurts. Thanks Danijerry!

    EDIT:

    Oops, spoke too soon. It keeps creating guns and helmets every tick which kills the frame rate. I tried putting a "Trigger once while true" to no avail (which never seems to work, so perhaps I'm using it wrong". The "For Each" event's description is "The actions will repeat once for each instance of the object", so I'm not sure why it's spawning them continuously.

    CAPX - http://dl.dropbox.com/u/5478701/Shadowtest/instancepinninghelp2.capx

    EDIT 2:

    Okay I figured it out. Instead of replacing the "On start of Layout" with the "for Each", I made the "for Each" a subevent.

    CAPX - http://dl.dropbox.com/u/5478701/Shadowtest/instancepinninghelp3.capx

  • I have manually placed 5 Enemies on the layout. At the start of the layout I want each enemy to spawn a Gun and a Helmet, and have that Gun and Helmet be pinned to the specific Enemy that spawned it. At the moment each Gun and Helmet gets pinned to the first Enemy instance rather than the one that spawned it.

    Here's a capx I made showing my problem (and I assume also showing my lack of understanding on C2 basics):

    http://dl.dropbox.com/u/5478701/Shadowtest/instancepinninghelp.capx

    Thanks if anybody can point me in the right direction!

    PS: I've had no problems getting sprites to pin to their creation instances during other events, such as "On Mouse Click" spawn Enemy->Enemy spawn gun->Pin Gun to Enemy. But it doesn't seem to work for "On start of Layout". I've tried with other Events (like an overlapping invisible sprite, or Compare Time) but even with "Trigger Once if true" at the end of the event it just constantly spawns new sprites every tick... which is a completely different problem I'm having, and which is why I want to use the "On start of Layout" for the gun/helmet spawning+pinning.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi Everybody,

    Just started getting into C2 and I'm really enjoying how user friendly it is.

    I made a quick test of a 2d lighting solution.

    <img src="http://dl.dropbox.com/u/5478701/Shadowtest_orig/shadowtest.jpg" border="0">

    You can try it out here.

    And here's the Capx file.

    One problem I'm having with it is the Additive blending mode on the light. It works fine as long as there's a background sprite is on the same layer as the light and shadows, but it won't work if the background sprite is on a layer below it. I can make the Additive blending work by setting "Force Own Texture" to No on the Light and Shadows layer, but this breaks the shadows. So it seems like I can't have both an 'additive' light and 'destination out' shadows at the same time, only one or the other. At the moment in the capx file, there's a second copy of the background sprite in the Light and Shadows layer (as well as one on the Background layer), if you delete this you'll see what I mean by the Addtive mode no longer working .

    If there's a way to get that Additive mode working with the shadows, then you should be able to have multiple light sources in different colours, which could be pretty cool.

    I hope somebody finds this useful, or could point me in the right direction to get the rest of it working. Thanks!

    Edit: I'm getting 60 fps in IE9, but for some reason it only works locally. In firefox I'm getting 50 fps, and in Chome I'm only getting 20! No idea why.