dop2000's Forum Posts

  • robotpencil I think you can do the same with 8-Direction. Disable standard controls, set acceleration=10000, deceleration=0, On key pressed simulate controls.

  • There was something wrong with your project, some bug maybe. I created a new project with the same Physics movement and scrolling and couldn't reproduce the jittering.

    So yeah, use 8-Direction and everything will be fine.

  • No problem, glad I was able to help!

    And it didn't take any time at all

  • I think you can still use "find". And if you want to pick TextObject with your event, do this:

    System -> Pick by comparison -> TextObject where find(TextObject.text, "Shooter")>=0

    This will pick all TextObjects which contain this word.

  • I think what you are looking for is the find() expression:

    Set variable S to "The quick brown fox jumps over the lazy dog"
    
    System-> Compare two values -> find(S, "fox")>=0   
    [/code:5lcduap9]
    
    find() expression returns position of the string ("fox") inside another string (S). 
    It returns -1 if string was not found. So if the result >=0, this means that the string was found.
  • Yeah, for some reason when you use Physics, jitter happens.

    Although it looks like the sprite moves with constant speed, on some frames its x,y coordinates are not updating:

    X.............dt

    2410 0.016657

    2421 0.016676

    2421 0.016625

    2431 0.01665

    2442 0.016645

    2452 0.016638

    2463 0.016682

    2474 0.016693

    2484 0.016655

    2495 0.0166

    2495 0.016657

    2505 0.016651

    2516 0.016657

    I don't know why this happens, but I'm guessing that's what causing the jitter when scrolling.

    Why are using Physics anyway? With 8-Direction behavior scrolling works perfectly.

  • 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.

  • Correct, "time" is different from the system time.

    "time" starts from 0 when the application starts.

  • DolyGamesCosmos

    Firebase is a commercial product (with free plans available) owned by Google, so you can be fairly sure it will continue to work after X months or even years

  • 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)

  • You can download that SVG plugin from github:

    https://github.com/JohnnySheffield/C2_Plugins_Pode

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't have any other AJAX requests or AJAX->"On any completed" in other event sheets?

    I would change "On any completed" to "On 'ScriptLoad' completed" just to be on the safe side.

  • Could you share a screenshot of your events? Just to make sure that you are doing everything correctly.

    I guess you can try a stress-test. Change your code, so that if AJAX loads the file successfully, the game exits. If "On error" is triggered or AJAX.lastdata is empty, display some debug information and don't exit the game.

    Then set up Windows Scheduler to run your game every few seconds. Or create a batch file RunAgain.bat :

    MyGame.exe
    timeout /t 10
    RunAgain.bat
    [/code:c9t5koy0]
  • There are third-party services that can be used to host leaderboards. (Don't ask me how they work though, I haven't tried any of them)

    Here are a few links:

    https://www.scirra.com/tutorials/1465/l ... rse-plugin

    https://www.scirra.com/store/royalty-fr ... ebase-2609

    plugin-firebase_t121776

    plugin-firebase_t91232

    There may be more examples in the Tutorials section, search for "leaderboard":

    https://www.scirra.com/tutorials/all

  • Did you put "Set StartTime to time" at the "On Start of layout"?

    Then yes, it will be very close to 0 when you launch the game. (because "time" starts from 0)

    Every time this layout is restarted, StartTime will be updated to current time.