AllanR's Recent Forum Activity

  • I just tried a couple things with my sample and both worked...

    either make another "Glow" sprite the colour you want

    or add the Tint (or SetColor) effect and set that to the desired colour.

  • well, I guess the only option I can think of would be to have two darkness layers. one below the ground for the sun/moon light, and then one above the ground for any foreground lighting.

    I am not 100% clear on what you want it to look like, so if that suggestion won't work then make a sample image showing what you are after - or a sample project to play with.

  • that would be a picking issue. each knob has to pick the correct slider before it can be aligned properly.

    lerp is a lot like clamp, you give it a start point, and an end point, and then what percentage of the way between the two it currently is.

    so when the percentage is zero, it will be at the start point, at 100% it will be at the end point, at 50% it will be half way between the two.

  • ok, the darkness can stay above the ground, maybe just move the sky to the bottom.

    see this example I made several months ago...

    the moon is on the bottom layer, but has a light on the darkness (MaskLight) layer. the torches, player and fireflies all have their own light too...

    https://www.rieperts.com/games/forum/LightMask.capx

  • ok, then there should be no problem to move the sky and darkness levels to the bottom.

    normally, the bottom layer is set to not be transparent, so make it transparent. And then set the sky layer to not be transparent...

    are there other reasons why you don't think you can move the layers? 300 events isn't too bad to fix issues to make it do what you want!

  • I remember following that thread :)

    the first function will completely execute before the second one, but since they are both called from the same top level event, the objects will not have completed the creation process.

    I took your sample file and added a couple buttons - one to call the two functions without a wait, and one to call with a wait. (and a third to clear the board)

    without a wait the spFloor.Count is zero, and the Pick All fails because there is nothing to pick yet.

    with the wait, calling the same functions, it works just the way you expect it to work.

    https://www.rieperts.com/games/forum/TileTest.c3p

  • a good rule of thumb is to always reference layers by name instead of the number - just so you can add or move layers without trouble...

    how many events do you have? it might be easier to replace all layer references with a name

  • have the sky (sun/moon) and darkness layers behind (lower than) the ground layer.

  • the wait 0 is critical to making it work. without the wait 0, the tiles will not have finished the process of being created when the CreateEnemies function is called. it is not a bug, Ashley has said it is a "feature" of the way objects gets created in Construct and to change it would cause too much trouble.

    with the wait 0, the tiles will be fully created and can be picked the way you want.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • calling a function is no different than copy and pasting those actions into the place where the function is called (except the function doesn't know what objects were picked when it was called). But the actions in the function can still only pick objects that were available to be picked at the point it was called, so it is really still part of the same top level event even though you divided it into two functions.

    if you want the tiles to be fully created when you add the enemies, then the enemies must be created in a separate top level event.

    so, if you don't want to do:

    AJAX on complete - call function CreateLevel; wait 0; call function CreateEnemies;

    then use a GameState variable:

    AJAX on complete - Set GameState to "CreateLevel";

    System GameState = "CreateLevel" - call function CreateLevel; Set GameState = "CreateEnemies"

    System GameState = "CreateEnemies" - call function CreateEnemies; set GameState = "LevelReady"

  • I made a quick test...

    the square button doesn't try to evenly distribute the wingmen at all - just randomly creates them.

    the circle button evenly spreads them apart.

    there are textboxes to enter the number of wingmen you want, and the offset from the cruiser...

    https://www.rieperts.com/games/forum/wingmen.c3p

  • you can get from a position on one layer to that position on another layer using "LayerToCanvasX" and then "CanvasToLayerX"

    so, you might want to put image points on your Sun-Moon...

    it was easier to make a sample than try to explain it.

    https://www.rieperts.com/games/forum/sunmoon.c3p

    the sun/moon are on the "Game" layer because the free edition only allows 2 layers, but you should get the idea.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies