robotpencil's Recent Forum Activity

  • So I used another editor and use physics to move my main and it seems to perform great. So I assumed the same with construct. The editor I use is Playcanvas but what I lose out on is the intuitive 2d art making. Construct has a lot of great features for 2d and was working fine until this. Not sure why it's jittering but it's no big deal. The set position is fine.

    I like the idea of 8 (or 4) direction movement but applying force seemed like a simple solution to the type of movement I'm after and kept the code lighter.

    I'll play around with it today and report later.

    Thanks again guys. You f'n rock!!!

  • Wait, I don't understand. Why do you need the second sprite? Is it for scrolling only?

    So the Mech moves smoothly and jitter only happens when you add scrolling?

    Why don't you try this:

    System->Scroll to X -> lerp(scrollX, Mech.X, dt*4)

    System->Scroll to Y -> lerp(scrollY, Mech.Y, dt*4)

    Also, the link you posted if broken.

    First of all... your solution is dope! Didn't know I could do that instead lol I was following a tutorial that had the 'camera' follow the player. But if the system can do it, then why make a camera. Either case, it still jitters. But now I have the system follow the player. But having a slight Delay would be nice.

    Second of all DOH on the broken link! Try this one. >> dropbox.com/s/gw56nkhazc5u2jw/umsd-remix.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not clear from your gifs which object is Sprite and which is the Character?

    Is the movement smooth if you disable Physics behavior?

    You should avoid changing x,y position for Physics objects, directly or with other behaviors like Bullet, Sine etc.

    Ideally physics objects should only be moved using Physics actions like Apply Force, Apply Impulse, Set Velocity etc.

    See this demo for example - the ball is moved to mouse position using impulses (last 3 events):

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

    Also, to ensure consistent movement on different framerates, use lerp with dt:

    lerp(Self.X,Sprite.X, dt*10)

    Thanks for the response. So what I've done is applied physics to my character ( The mech ) and made a sprite that scrolls by following the mech.

    Just occurred to me to share the file for help. Here it is! >> dropbox.com/s/gw56nkhazc5u2 ... x.c3p?dl=0

    Also I tried the change you suggested and it didn't work <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad" />

  • Character Jitter when using lerp() on my Physics Sprite.

    Basically, it looks like this using the simple lerp function on set position: lerp(Self.X,Sprite.X,0.3) & lerp(Self.Y,Sprite.Y,0.3)

    I've tried messing with the 0.3 value, but nothing really works.

    See how it pops. And here is it when I just have the set position to Sprite.X, and Sprite.Y

    Smooth animations and framerate.

    And here it is with no camera move.

    Also smooth.

    Now I have achieved this same effect in this game I made using Playcanvas, but what I did was use simple math like finding the difference between the two points, then dividing it by a variable that controls the speed. For instance:

    (Self.X-Sprite.X)/thisSpeed[/code:8pgfygbc]
    
    Here is a game where I used a different code set up and used basic math functions to make it work.
    https://robotpencil.itch.io/telemega
    
    I've used it in other games I made and it works great. I just need to know if there are basic math functions I could use like +-*/
robotpencil's avatar

robotpencil

Member since 1 Jan, 2018

None one is following robotpencil yet!

Trophy Case

  • 6-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies