calminthenight's Recent Forum Activity

  • I suspect if you wanted to continue using the current method that you could add an instance variable to the stack of enemies, something like "is on slope" then use that as a condition with something like:

    If enemy is on slope & not falling & has enemy at offset below then set enemy.Y to enemybelow.Y-100.

    EDIT: I ended up playing around with the Scene Graph tools for a bit of fun and have come up with a much more robust system. Any goombas on top of the bottom goomba automatically inherit the bottom goombas movements. This means they can travel in any direction. When a bottom goomba is destroyed, the next goomba falls to the ground and becomes the bottom goomba, which then adds any above goombas as children of it.

    1drv.ms/u/s!AkmrWgxeuxlKhIcNlIeglSsUumgCDg

  • It would be easier if you posted your project file. Without knowing the rest of the mechanics it makes it a bit of a guessing game. There's a lot of ways to do it and a lot of things that could interfere.

  • No Worries.

    Yes the overlap at offset checks for an overlapping object at a specific distance. You could use any number within the size of the object to be checked here to find an overlap. Here I'm using it to check if a goomba is seeing another goomba or the ground directly beneath it.

    The goombas are 100x100px so that's why the formula has the current position of the goomba +100. On the Y axis, + is down with 0 being at the top of the screen.

    Lerp is a way of smoothly interpolating between two numbers at a given rate, so we are asking it to move from the current Y position of the object (self.Y) to a predefined position which is the original Y position of the object+100px on the Y axis (self.Ypos"instance variable"+100px), and we are asking it to do it at a rate of (dt*10). dt is Delta Time which is based on the frame rate. You could also use any number between 0 and 1 instead of using dt to determine the speed.

    So the *10 isn't correlated to the offset of 10, it's just the speed that I chose.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • almostdarkslide

    Another way you could achieve this, provided the actual layout of your level isn't changing is to just switch animation frames or tile-map tiles. So your pristine world sprites are all in animation frame 0, and your destroyed world sprites are in animation frame 1. You could then dress up the transition in any way that you wanted, if you even wanted to.

  • I've done a quick example using individual sprites. There are plenty of ways you could do this though, including using the new hierarchy tools.

    In the example you click on the goombas to destroy them, this could be substituted with whatever method of removing them from the game you choose.

    1drv.ms/u/s!AkmrWgxeuxlKhIcMiraEjTB8iJqfNg

  • The camera position is based off where the mouse is on the screen, you can see by moving your mouse outside of the window then returning it at a different corner, the camera will move to that position.

    There are many ways you could do this but i have replicated the behaviour using lerp to lerp the X and Y positions of the object that the camera is scrolling to, to the positions of the mouse in relation to the centrepoint but divided by 10 to limit the camera's movement.

    Let me know if you have any questions :)

    Demo here: 1drv.ms/u/s!AkmrWgxeuxlKhIcLU9fa3WTI5aMhMw

  • Just change the 3rd number in your deceleration lerp to a lower number, but make sure you use a "dt" calculation rather than a fixed number to keep it frame-rate independent.

    So instead of lerp(X,Y,1) use lerp(X,Y,dt) or lerp(X,Y,dt*2) or dt/2 or 3 etc.

  • You can use the regex expression and do a comparison. I haven't done it personally, but there a few forum threads about the same thing you're asking.

    construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

    look up the regex expressions

  • to add timers like this to things i usually use a variable and then have an event that sets to variable to the time you want and an event that continuously removes time from that variable.

    for example: You make an instance variable on you player called "boosting"

    then for example

    When shift key pressed - set "boosting" to 0.5 (this gives you the amount of time you are after)

    then you link the action you are seeking to that variable being greater than 0. e.g.

    If player.boosting > 0 - set max speed to 100(or whatever u want)

    Inside this event you have a sub event that handles the countdown of the variable

    so sub event: -- every 0.1sec subtract 0.1 from player.boosting

    then finally you have an event that resets the action to normal when the counter has run down

    If player.boosting =<0 - set max speed to 50(or standard speed)

    Here is an example that i did for someone else of the same technique, that means that for 5 seconds after a player has overlapped the blood pool, they will produce bloody footsteps while moving. Same method.

    1drv.ms/u/s!AkmrWgxeuxlKhIcKKuFgyNMlgcROYw

  • The only way is to use "set playback rate" which will effect the time and pitch of a sound. Alternatively if you are looking for variations on say a laser sound, use multiple sound files and pick one each time the sound is required

  • EDIT: just realised already suggested this

    Looks like a bug to me. Have you tried doing it without using the sine behaviour? You could just lerp the Y position of the platform and achieve the same result. Then you could see if the problem persists.

    I'd use:

    If platform.Y is at lowerlevel.Y

    --Set Y lerp(lower.y,higher.y,dt*whatever)

    If platform.Y is at higherlevel.Y

    --Set Y lerp(higher.y,lower.y,dt*whatever)

    If this works correctly with the jump through behaviour you won't need to use your workaround.

  • Good to hear you got it. To do that you would use an instance variable on the player object. Say we call it "bloodied".

    Use the trigger: if player is overlapping blood pool - Set "bloodied" to 5

    then

    if player variable "bloodied" > 0 - then every 0.1 seconds subtract 0.1 from "bloodied"

    - sub event: If player is not overlapping blood pool - Spawn footprints

    1drv.ms/u/s!AkmrWgxeuxlKhIcKKuFgyNMlgcROYw

    :)

calminthenight's avatar

calminthenight

Member since 28 Jan, 2018

Twitter
calminthenight has 6 followers

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies