AllanR's Forum Posts

  • if you put them in a family, you can use the Create Object command with the family name. That will give you a random member of the family (which could be the one you just killed again).

    if you don't want duplicates, or want them to appear in a certain order, it gets a little more complicated. You can use an array and pick a random entry in the array, and then delete it from the array to make sure you don't get it again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • do you have to use iFrame? have you tried the video object? that gives you events like Has Ended, Is Playing, Is Paused...

  • what is happening is that when you move the ground (Block) forward, the car moves with it. Then the car eventually falls off the ground.

    you can see what is happening better if you set the Layout scale to 0.5 in the Start Of Layout event (event 1).

    either make the ground invisible and stationary - and just have the scenery move past, or spawn new ground to move on to the screen.

    I updated your file to do the latter...

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

  • I haven't tried it, but I think using & in that case is just concatenating a long string - not evaluating one value AND the next.

    So, I don't think using the logical or | symbol is going to do what you want.

    I would use an array or json string to hold the name of the audio file for that level, then you wont need to have an event for every level.

  • I like to reset all the button animations first, then check if mouse is over a button, I pick the top one (in case you have overlapping buttons) and set its animation to hover.

  • if you are just drawing vectors, have you tried using sprites for lines instead of a drawing canvas?

    here is a sample I was playing with a while ago to make bezier curves... I added lines and a button to start/stop rotation of the layer the lines are on. The end points for lines and the "fixed" two point bezier are containers so that the other parts are automatically selected if you start dragging them around.

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

  • can you rotate the layer instead?

    edit: I didb't fully read the first post...

    when you are drawing on the canvas, you might have to calculate the layer coordinates for the layer the canvas is on by using LayerToCanvas, and then CanvasToLayer

    but I haven't tried that...

    edit2: ok, just tried it and got funny results - so tried it in C2 and it seemed to work the way I would expect, so it might be a bug in C3.

  • here is a sample I made for someone months ago - it was specifically for how to make a mask object on the mask layer move with an object on a different layer with different parallax settings... (which is what is going on in event 13)

    I updated it a bit to allow for colored lights...

    there is a family called LightSources, and at the beginning of the layout, each instance of the family gets a glow object created for it, set to the appropriate settings for the object.

    This doesn't localize the light the way Terraria appears to, and it has nothing to do with tile sets, but hopefully it might give you some ideas! :)

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

  • I would create a global text variable called Biome and set it in event 4 after you initialise the array.

    then in event 5, set the new Tile_All animation to Biome, and set the frame to int(random(0,4)) and set the array value there as well.

    I am not sure what will happen when you set the frame to a decimal value... but that is probably part of your problem.

    do you have any other code that sets the animation? because I would think what you have there should work - other than not taking the int() of the random number.

  • the code that makes the connections is a subevent under the event that checks if Layer 3 (Game Over) is visible. Since Layer 3 is not visible, the pieces of the bridge are not getting joined together. I moved the code out to the top level, and then it seemed to work.

  • don't do it on bullet created - it wont remember which enemy spawned the bullet. do it when the enemy spawns the bullet so you can check right there whether the enemy is mirrored and set the angle appropriately

  • The order you do the check in will determine whether the correct enemies get picked.

    checking "player.x < enemy.x" will NOT pick enemies (it will pick player), so it will affect all enemies.

    so swap it around...

    "enemy.x < player.x" will pick all (and only) enemies with x less than player. in this case, no "for each" is required.

  • nicely done! :)

  • just add another condition that says "Every 1 Seconds"

    also, it will continue to count down after it gets down to zero - because it will still be less than or equal to 100...

    (unless you have code somewhere else to end the game if it gets to zero.)

  • did you define the PlanetFacts array to have enough room on the Y (height) axis to hold the facts? If not, the default is 1 which will only work for the first one...