AllanR's Forum Posts

  • I would use the rotate behavior, because that uses dt so the rotation speed will be consistent regardless of the frame rate. Manually doing it without dt will make the pointer go crazy fast on a 144Hz monitor, and barely move on old devices that get low fps rates.

    then you can reverse the rotation speed when it hits a target angle range. You have to use a range because one frame the pointer could be just under the target, the next slightly over the target...

    using open ended checks like angle <= 345 will cause trouble when the angle crosses over 0, same for angle >= 30.

    I made a sample where you can adjust the rotation speed and drag and drop limit markers to play with.

    https://www.rieperts.com/games/forum/PointerRotate.capx

  • as far as I know, the only ways to change the order would be to start a new version of your project, or download a copy of your project to your hard drive, unzip the whole project, open the project.c3proj file in a text editor.

    near the beginning is a section called ObjectTypes, I haven't tried this with C3 (only tried in C2), but if you rearrange the items into the order you want to pin in, then it should eliminate the lag.

    make sure you don't break the code - each item has a comma after it except the last item, so watch out for that.

    then save the file, re-zip the whole thing, and open in C3 and test.

    this seems like a poor way to deal with this problem though, and if it isn't documented anywhere there is no guaranty that a future update wont change how this works.

    pinning everything to the same base object seems easier to me, and more likely to continue working in the future. Plus, if you have overlapping panels (as I often do) then knowing all the objects that belong to a panel makes it easier to pick the objects to move a panel to the front, or send it to the back, or close it.

    EDIT: just tried rearranging the ObjectTypes section in Dop's sample file, and it does fix the lag.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • wow! how have I never heard that, or stumbled on it?

    I just did a few quick tests...

    if the objects being pinned are all instances of the same object, then UID or creation order does not seem to matter at all.

    However, if you are pinning together a chain of different object types, then it matters what order they were added to the project (not the UID or order they are created in on the layout).

    So, to avoid lag, you can only pin an object to another object type that was added to the project before the object being pinned.

    just to make sure, I closed the project, opened the .caproj file and changed the order of a sprite, saved, then opened the project in C2 and then there was lag - both in preview mode and after exporting.

    so, that is a pretty big condition, but now I know it is possible!

  • the on fade complete is a trigger and should go out at the top level, not in the function.

  • yeah, there is no way around the lag if you double pin...

    so, like orlic said just pin everything to the same base object.

    I make control panels, and have plain buttons that have the normal/hover/down animations, then I have text and icons for each button. Every icon and text object knows what button it belongs to, and it knows what panel object it should be pinned to (using instance variables).

    you can have as many layers of objects as you want, as long as everything that needs to drag together is pinned to the same base.

  • this gets a little closer... it doesn't use a swipe to change the player, but this tests gravity outside the circle and inside the circle.

    https://www.rieperts.com/games/forum/Gravity2.capx

  • the event sheet runs 60 times a second, so trying to slow down the execution of a function with a while loop probably will not work.

    dop2000's repeat loop works because it adds a series of ever increasing waits. but the function itself finishes in one tick.

    is there a reason you don't want to use the Fade behavior, and the On fade finished trigger?

  • for the second mechanic - you say you want the ball to move at the speed of the swipe. but what happens if the swipe slows to a stop, or reverses direction? does the ball move if it is already on the top and the player swipes up again? what happens if the player tries to swipe with two fingers and one swipes down and the other swipes up? what's the point of moving the ball to the other side? you mentioned reversing gravity - is the ball supposed to be movable in any other way?

  • give this a try...

    it uses the Platform behavior, sets the Platform angle of gravity to the center of the circle. Default controls are turned off so that we can lock the player's position by ignoring left and right movement. Jumping is a little tricky because it is really hard to have a player on a round object - you can't get the collision mask smooth enough for it to think it is always on the ground as it moves over the surface (or as the surface moves under it in this case). So, I use a second circle object that is a little bigger, and if the player is overlapping that when the up arrow is pressed (or a tap gesture) then do a jump.

    just for fun I added a button to toggle fixing the player in one spot. When not fixed, the player can run around the planet - gravity is constantly being set to the middle, so he wont fall off.

    https://www.rieperts.com/games/forum/Gravity.capx

    EDIT: just added an obstacle to jump over, and a detector to tell us if we successfully jumped over the obstacle.

  • I just posted a bug report, because Ashley gets tagged in millions of posts and may never see this...

    https://github.com/Scirra/Construct-3-bugs/issues/3379

  • are you still using html buttons, or did you switch to making buttons from sprites and text objects?

    html buttons are not part of the canvas, and getting rid of the lag is pretty complicated. ROJOhound found a solution a year or so ago, but I would have to do some searching to find it.

    if you are using sprites/text, then everything must be pinned to the same moving object. If you have a panel that slides in, and buttons pinned to that, and text pinned to the buttons, then the text will lag behind. The text should also be pinned to the panel.

    make a small test file with sample buttons so we can see what is going on.

  • event 56 is a trigger and shouldn't be a sub-event. when the animation finishes the other conditions aren't true so it doesn't get to the sub-event.

    move event 56 out to the top level and it should work the way you want.

    since you are playing the default animation, that animation will start playing at the start of the layout (which may be why you moved it to be a sub-event). So, to stop the trigger from happening when you don't want it to, you can stop the animation at the "On start of layout"

    or add another condition to the trigger where you compare two values:

    system - Compare TimeScale = 0

    or use your Pause_Button variable as another condition to the animation finished trigger:

    system - pause_button = 1

  • web storage has been phased out, and replaced by Local Storage.

    So, all you need is Local Storage to save a local high score.

    if you want a global leader board, then you have to set up your own server database, or use some other service...

  • I just went all the way back to when the new functions were released in R143 - and the picking worked from that release all the way to R166.

    starting in R167 it now has reverted back to how it worked with the old functions.

    a C2 project that uses the old functions opened with releases R143 to R166 still work the old way, but if you convert to the new buit-in functions starts working the new way.

  • OKAY!! so, I am not totally crazy!

    I had two versions of C3 open, and happened to open your sample in R164.3 (the latest stable). It does indeed work the way you said,

    but I just opened it in R168, and it does not work - works the way I said. (adding the wait 0 then makes it do what you want).

    so, I went back to your original file (problem.c3p), opened it in the stable version and divided your function into two and it started working, but it also does not in R168. (haven't tried other versions). So, we have uncovered a bug (or at least a change) in C3...

    do you want to file a bug report with your last sample? it works one way in R164.3 and another way in R168.

    the way it works (or doesn't) in R168 is the historical way I understand picking. the way it works in R164.3 is an improvement - although I find it strange that it works with consecutive function calls, but not when one function calls the second.

    EDIT: just checked other versions - it worked up until R166, stopped working at R167.