JayH's Recent Forum Activity

  • Hi,

    Well I thought I knew, but obviously...

    I'd like to know the methods you can move a sprite manually (horizontally or vertically). This is for a Moving Platforms, although might have other uses.

    The Sine Behavior is out, as it has issues with smoothness at low resolutions when a Player is on it (I have another post on that).

    Until now I've used the Bullet Behavior, but this has it's own issues as it uses an angle to flip it's direction, in-turn mirroring the sprite about it's axis/origin.

    I was curious of the Custom Movement Behavior, but can't see how to use it in the Event Sheet - there's no online info of it implemented anywhere.

    I'd obviously like to keep Delta Time too, so that will be needed too to add to the mix.

    Thanks in advance.

  • Thanks, I thought that too.

    Instead of using the Sine behavior to move a platform, I implemented my own by using the Bullet behavior. I just reverse the angle when a position is reached and the same in the opposite direction.

    It's smooth and glitch free!

    The only caveat is that you have to design your moving platform to be symmetrical and an odd number of pixels in order for the origin point to be placed in the center. The angle change is essentially flipping the object on it's axis, similar to mirrored.

    Of course there are other ways to move a sprite, but this is the quickest and already has delta time added as far as I'm aware.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Disabling Pixel Rounding does indeed help while the Player travels left to right on the moving platform, however, when the Moving Platform reaches the left side, the player moves left then right one pixel quite slowly. It looks rough.

    Additionally, a similar behavior can be seen when the platform goes vertically. the Player moves up one pixel, then down one, jittering all the way up and down.

  • I've been developing a retro pixel platform game in Construct 2, but I've run into an issue which I don't think can be fixed.

    I've tested this with Construct 3 also, so I'm assuming that this is a continued problem.

    The problem is easy to re-create.

    Steps:

    1. Use the Retro Pixel Platform Layout

    2. Create a Platform with Solid Behavior

    3. Create a moving platform with Jump Through Behavior and Sine Horizontal

    4. Add a Player with default Platform Movement

    When the Player jumps onto the moving platform there is a noticeable jitter / shake / wobble / glitch in the movement. It's as if the two sprites are fighting with each other and their behaviors as they re-fresh.

    You would expect that the player locks to the platform and the platform just carries on, but the smooth animation is lost and looks very unprofessional as the platform jitters and the player is updated slowly.

    I can't be the only one to have noticed this issue, is there a way around this? It's more noticeable with low-resolutions such as 320x180, but it's still there none the less.

  • Thanks Kriand, I'll take a look.

    Edit: I've now tried the example you gave and both seem to work ok. The dt one runs, but like with most dt stuff I can't verify if it's truly working. Not the most elegant solution, but a welcomed working one all the same, thanks.

  • Thanks Kriand, I guess it's a tricky one then.

    I really need my events to avoid frame dependence, so I have to try something with dt. I was hoping for a neat and tidy method without creating lines of code and variables for something that appeared so plain that could be in an equation. Maybe Lerp just isn't the right method, unless someone can offer any other help.

    Cassianno, sorry, no that makes no difference, we've still got movement, but without a step of 12 pixels, I understand where Kriand is coming from.

    Plinkie, I look into the viarable for the player.

    I have more research to do!

  • It's moving smoothly, but not in 12 pixel segments/blocks. It looks like it should work, but doesn't.

    Here's a screenshot to make it clearer:

    https://db.tt/fnUP8fU4BP

  • yep, lerp() is what you need. It is a math function used in basically in all/many games/engines.

    Darn it, my posts here keep disappearing!

    Ok, I've gone through lerp, but I'm still stuck.

    I've tried this:

    obj_Player = lerp (obj_Player.X, obj_Player.X + 32, dt)

    But it's too quick to know.

    I've tried this:

    obj_Player.X = lerp (obj_Player.X, obj_Player.X + 32, 60*dt)

    and

    obj_Player.X = lerp (obj_Player.X, obj_Player.X + 32, 60/dt)

    I've also tried this from the below blog post:

    obj_Player/X = lerp (obj_Player.X, obj_Player.X + 32, 1 - 0.5 ^dt)

    https://www.construct.net/gb/blogs/ashl ... a-time-924

    I also checked out this post:

    how-do-i-lerp-with-dt_t129150

    Any help please?

  • Thanks guys, I'll check out Lerp today as it seems the most specific to my needs, I'll have to use dt too for the movement between, not specifically 1 pixel at a time.

  • Probably quite self-explanatory from the title.

    I'd like to move the player 32 pixels on each keypress, but move the him smoothly pixel by pixel. In other words, slide 32 pixels at a time.

    Thanks.

  • Hi Per,

    Thanks for the information. I'm not that keen on having the logo, although I probably shouldn't care. I'm wondering about upgrading to Construct 3, but I'm not that keen on using it online - I hope there will be an offline editor at some stage, I'm old school and like to have actual software, but I guess if a companies server is down, your old license isn't worth anything anyway... I digress. It is tempting though and possibly the less hassle route - I'd better do some reading up on it's specifics.

    I checked out your game, unfortunately it wasn't easy to find in the Google Play Store, either because it's new, or because of the "!" exclamation marks... I've no idea.

    Hard game for me sadly, but I dug the music - reminded me of my old Amiga Tracker days.

  • Thanks mrtumbles, that seems to have done the trick. I've yet to totally grasp delta time, I know what it does, but using it is another matter.

JayH's avatar

JayH

Member since 8 May, 2017

None one is following JayH yet!

Trophy Case

  • 7-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies