dop2000's Forum Posts

  • Mixing platform and physics behavior in one sprite is a bad idea.

    My guess is that there are two sprites in that youtube video - the character sprite with platform behavior, and also an invisible sprite with physics behavior which follows the character copying its movements.

    Character makes all the platform stuff - running, jumping etc. And the invisible physics sprite interacts with physics objects - pushes, knocks etc.

    But this is only a theory and I may be wrong.

  • So you have 1000 frames with different heads? Why don't you split them into 100 different sprites with 10 heads each?

    Keep all these sprites on a separate (unused) layout, so that they are not loaded automatically.

    Add all 100 sprites to a family, say "HeadFamily".

    Then on start of your game layout create an instance of the sprite with the head you need.

    For example:

    System Create Head58

    HeadFamily Set animation frame 3

    This way only one sprite with 10 frames will be loaded into memory.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, as far as I know, LOS behavior only checks if target object is visible or not. And it only tests the target's origin point, not its collision polygon or bounding box.

    So to find an intersection point with an obstacle, you need to use the code I posted in my previous comment.

  • Here are two ways to achieve this

    Edit: Just noticed a mistake in my screenshot - axis(0,4) is obviously wrong, replace it with axis(0,0)

  • Here are a couple of ideas - if your low height obstacle sprites are relatively small, you can add a 3rd LOS with very narrow angle of sight. Rotate your AI towards the target position, then use this LOS to check for any low height obstacles in that direction. If found - move AI to that obstacle.

    Or you can do it with a loop like this:

    dist=Distance(ai.x, ai.y, target.x, target.y)
    progress=0
    
    While
    dist>=progress
         System Pick LowObstacleSprite overlapping point (lerp(ai.x, target.x, progress/dist) , lerp(ai.y, target.y, progress/dist))
               //  point of collision with LowObstacleSprite found, you can move your AI to it
               Stop loop
         Else
               Add 5 to progress    // 5 is to minimize the number of overlapping checks for better performance. 
    [/code:34sgjorq]
    
    This code basically moves a virtual point from AI to the target, checking if it's overlapping LowObstacleSprite every 5 pixels.
    It should have almost no impact on performance, unless you have lots and lots of AI objects and executing this code for each of them on every tick.
  • Pandy

    Check this post, it may be relevant.

    I posted a few examples there where I perform hundreds of overlapping checks per tick and the impact on performance is quite small. According to Ashley, overlapping checks in C2 are well optimized.

  • Lordshiva1948

    It would be nice if you read posts (not just the title) and other people's comments before answering.

    This post has nothing to do with LAN preview.

  • sean080

    You can do it exactly the same way, only instead of LayoutWidth/2 and LayoutHeight/2 use person.x and person.y

  • "startGame = wallclocktime" should only be executed once on start of the game (level), not on every pressed key.

    This formula is also incorrect:

    speedPerSecond= (totalHits) / (startGame)

    Change it to:

    speedPerSecond= (totalHits) / (wallclocktime-startGame)

  • Here is the easiest way to do it:

  • For Platform or 8-Direction object, disable standard controls.

    Use events like:

    Is key A down - > Player1 Simulate pressing Left

    Is key Left down - > Player2 Simulate pressing Left

    etc.

  • You can add all such sprites to a family.

    Then when you create a family object (using Create or Spawn action) - a random sprite member will be created.

  • It depends on the game.

    If, for example you want players to drag&drop tiles, then use a sprite at first.

    When the player drops the sprite to its location, you can destroy the sprite and modify the appearance of the tile at the TileMap.

  • Yes, you can display the speed in real time.

    speedPerSecond= (correctlyTypedCharacters) / (time-gameStartTime)

    speedPerMinute=speedPerSecond*60

    If you want round this number to two decimal places:

    speedPerMinute = round(speedPerMinute * 100) / 100

    I believe PPM refers to "Pages per minute" and it's used to measure performance of printers and photocopiers:)

  • And again you shared a demo instead of the event sheet...

    I modified my example, it now works with all keys except ' and /

    In firefox these keys invoke search function, so I would avoid using them in your game.

    https://www.dropbox.com/s/g06mg3tjulvlq ... .capx?dl=0