Asmodean's Forum Posts

  • Your TiledBackground2 isn't complete white. There is a line of pixels on the top and on the left which are transparent. Change them to white and it will work.

  • I have no experience with timing of sounds so this is all a complete guesswork, but did you do the timing with the overlapping the pattern with your seekbar? I wouldn't do something what needs a exact timing with a collision or overlapping event.

    I would put the pattern in an array and use the array to play the sounds in the correct order.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could give your player and enemy an instance variable like isDead and set if if in your collision events. And check in your events where you change animations, if isDead set to false.

  • like this:

    In this example you spawn a Sprite every 2 seconds randomly between x=840 and y=480 with one of the animation: animation1 or animation2 from Sprite.

  • The problem is, that your destroy-event is not triggered. The destroy-animation takes to long to be finished. The player is after a short time of the collision with the enemy back in the running-animation. So the destroy-animation never finished and your player will not be destroyed.

    With your enemy it's the same problem.

  • You have to unpin the spritefont and set the y-position new, after your scaling-event happens.

    event -> Spritefont | Pin unpin
          -> Spritefont | player.Y-player.Height/2-SpriteFont.height
          -> Spritefont | Pin pin to Player
    [/code:fcnbet1m]
    
    If your scaling is continuous you could use every tick instead of pin to set the position of the spritefont every tick. 
    
    System| every tick -> SpriteFont| Set position to (player.X-SpriteFont.Width/2, Player.Y-Player.Height/2-SpriteFont.height)
    
    The origin has to be in the middle of your Player-sprite.
  • It depends if you have only instances from one object or you have instances from different objects, then you have to use a family.

    I made a little example:

    https://drive.google.com/file/d/0B5FlDY ... sp=sharing

  • Ahh, now I understand.

    I'm afraid I can't really help you with that, that it really look good. There are people here I believe are fare more competent for this kind of problem.

    But I've tried something.

    It works, but it doesn't really looks like something 'flies in'.

  • What do you mean with 'de-spawning'?

    The easiest way is to create the object outside the viewport and move it into it.

    For example:

    System| Every x seconds -> System | create object Sprite on layer 0 at (-sprite.width-1, y)

    This will spawn an object on the left. -Sprite.width-1 pixel outside of the left border.

    If your sprite has the width of 32 it will be created at x=-33, y.

    Now you have to move it:

    System| every tick -> Sprite| Move forward -1 pixel.

    If you want to spawn it at the right side:

    System| Every x seconds -> System | create object Sprite on layer 0 at (OriginalWindowWidth+Sprite.width+1, y)

    System| every tick -> Sprite| Move forward 1 pixel.

    OriginalWindowWidth is the Windows width in the project settings.

    This will work as long as the screen doesen't scroll, then you have to use viewportleft and right

  • Ahh, sorry zenox98 I read it wrong. I read every second, not every 60th of a second. That is even higher what I observed.

  • zenox98 did you miss a zero in the amount of collision checks per second?

    emoaeden

    1. the scoring took a huge amount of cpu-time. Try to disable the scoring group and you will see it.

    2. I have up to 6000 collision checks per tick, that would be up to 360.000 collisions checks every second with 60 FPS. There has to be a problem with your collision checks.

  • Don't use the inspect tab to measure your cpu usage. Use the profile tab or use cpuutilisation as expression in a textfield. The inspect-tab has a high cpu usage if there are many objects by itself.

  • Maybe the answer is to easy:

    x= 6,879

    round(x*100)/100

  • You could try with setting a range of tiles. If you pick the upper left corner of your object with x=Sprite.X-Sprite.Width/2, y= Sprite.Y-Sprite.Height/2 (Origin had to be set in the middle of the sprite) and the multiple of the tiles to the sprite: width = sprite.width/tileWidth height = sprite.height/tileHight:

    Sprite| Is overlapping Tilemap -> Tilemap|Set tiles at (Tilemap.PositionToTileX(Sprite.X-Sprite.Width/2)),Tilemap.PositionToTileY(Sprite.Y-Sprite.Height/2)) with area ceil (Sprite.width/32) x ceil(Sprite.Height/32) to tile 1

    The tile width and height is in this example 32.

  • Try:

    Sprite| Is overlapping Tilemap -> Tilemap|Set tile (Tilemap.PositionToTileX(Sprite.X),Tilemap.PositionToTileY(Sprite.Y) to tile 1

    sprite is your collisionbox, tile 1 is the number of the tile you want in exchange.