AllanR's Recent Forum Activity

  • since your squares and walls are a factor of 32 pixels apart, another option would be to set the x to the nearest 32 pixel boundary:

    x = round(self.x / 32) * 32

    I also tried speeding up the squares as they drop down a line, but they gradually get farther and farther apart because they are at different speeds for short periods of time.

    if maintaining the space between them is important, then you might want to use an array to hold all the positions of the "head" square, and set the following squares to a relative place behind the head...

    I helped someone with that concept who was making a worm game:

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

  • I made a bunch of little changes - added a couple global variables for projectile type, and changed some animation names to match the projectile types to make it easier to set the one you want.

    I removed some of the "on animation finished" events because they weren't needed - the fade behavior automatically destroys the object when the fade is finished.

    I restructured a couple events, removed some duplicate code, and added a couple checks for game over so that the game can't continue after you are dead...

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

  • I like the art :)

    what happens is that event 3 fires a red HWB, and event 9 fires a gold HWB (if the highscore is over 80).

    if the highscore is over 80, both are fired, but you make the red one invisible, and the gold one visible (down in event 26).

    both projectiles will hit the enemy, so both events 10 and 11 will run. Since the gold projectile is slightly faster, it will hit first and then the red one hits and changes the animation to f1 (red HWB) right after the it had been set to the f4 (gold HWB). If they hit at the same time, then the f4 animation is set last so you will see the f4 animation.

    so, you don't want to fire the red HWB if you are going to fire the gold one.

    or you might want to make the gold one a new animation of the red HWB, and then set speed as necessary. That would remove duplicate code...

    there may be a bug with the end of game not always stopping play, but I didn't look into that.

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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