AllanR's Recent Forum Activity

  • one more thing I will add is that if you pin everything to the same base object (panel), you don't have to calculate an offset from the panel for each sub item getting pinned.

    set the button to where you want on the panel and pin the button to the panel,

    then position the text to the button, but pin it to the panel instead of the button.

    you position everything just as you have been - you just have to be sure you have the correct panel picked if there is more than one.

  • if multiple limiting tiles are visible, how is the camera supposed to know which ones apply? and which direction to limit the camera?

    can you post a sample file so we can see how you are placing the tiles?

  • this is what I would do...

    create Min and Max sprites for X and Y, and clamp the camera coordinates to their locations.

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

    this puts the limit markers where to stop the camera... you can still see beyond that so you have to calculate where to put them. if you dont want to see anything beyond the edge of the layout, you have to put these far enough in to accomplish that.

    it you want to set these at the limit of what you see, then you have to calculate an offset from them based on the viewport size.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • when the character collides with the green Sprite, add another condition (or sub-event) to pick the Entity Nearest Sprite.X, Sprite.Y

    Character - on collision with Sprite
    Entity - Pick Nearest (Sprite.X, Sprite.Y) -> Entity Destroy
    
  • I gave it a try... the only way I could do it with no flicker was to have the Fade sprite visible and covering the screen at the start of the layout. So, I put it in its own layer, and made the layer hidden so it doesn't cause trouble editing other things on the layout.

    I added Fade to the sprite twice - once called FadeIn and once called FadeOut. That way I could have everything preset - just not enabled.

    at the start of layout I enable FadeOut, so the screen goes from Black to visible. We get a trigger when that is done, so we know the game (or menu) is ready to go.

    when it is time to leave the layout, I start FadeIn to go from visible to Black. That gets its own trigger, so we know when to call the next layout.

    I didn't use a function or any global variables - just the triggers.

    https://www.rieperts.com/games/forum/FadeInOut.c3p

  • You do not have permission to view this post

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

  • 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

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies