ome6a1717's Recent Forum Activity

  • I'm getting very strange occurrences in my game. The simple version is I have A and D mapped to left and right (simulating a platform behavior). That works fine. I also have shift mapped to a dash ability. My code makes sure you can't move while you're dashing. Overall, everything TECHNICALLY works exactly how it should.

    However, if I press and HOLD shift and a direction, sometimes it will dash, and then the player won't move. If I let go of shift while continue to hold the direction, after a half a second after releasing shift, the player will start to move again.

    When I remap shift to the right mouse button, this goes problem goes away. For some reason, the shift button being held is somehow stopping the other keys from being pressed or held. Does anyone have any insight as to why this would be happening?

    It's definitely not my code, because I just made a simple barebones test c3 project and it's happening in that, as well.

    https://www.dropbox.com/s/zs2toih3q95f8ua/ShiftKeyTest.c3p?dl=0

    Any help would be greatly appreciated!

  • - okay! I was wrong :). Apparently global layers actually are meant to delete and recreate the initial object on start of layout. I want to do more testing to see if the same goes for sprites, but it seems a global object on a non global layer should work.

  • Ah, yes it is a bug. Made a brand new project to test it; tilemaps get reset on next layout. I'll put it on the github.

    Thanks !

  • - Correct, the object is not a global object, but the layer is. There's no visible code that would clear any of it, only add to it. And it is adding correctly, but it's deleting what was added on the previous layout.

    Unless I'm unaware as to how "set tile" works and it actually clears the map and sets the tile specified? It's literally the only line of code that is affecting the tilemap.

  • - yeah, that's what I was afraid of. It must be a bug then :( Back to the drawing board!

  • If I put an object on a global layer (such as a tilemap), and then switch layouts, how do I make the tilemap stay the same (in terms of tiles) if I load the next layout? It keeps getting reset and I have no code would change it. I tried making the object global, as well, but it then made a copy of the same tilemap on a different parallax layer...(pretty sure that's a bug, but I don't really have time to figure out why.)

  • I would use the tween behavior. Tween one value (x + A). You could even give it a tag and do:

    On tween end “IN”, start tween “OUT” (x - A).

    And then vice versus if you wanted it to still sine indefinitely. That will be the most accurate.

    I think easings.net will be the best place to look at the curves you can choose from.

  • NetOne

    That’s what Ashley is making it sound like. In theory that makes sense, too. The alternative would be a ridiculous waste of resources.

  • Ashley - thank you for clearing that up!!

    EDIT - Found the tutorial just for reference:

    https://www.construct.net/en/tutorials/optimization-101-collision-1166

  • Conditions only check the instances picked by previous conditions. So you can use a condition to filter down the picked instances to just a few, and then the next conditions will only run on those instances.

    Testing overlaps is actually a good way to filter down instances, because it uses the collision cells optimisation to avoid even checking far-away instances. So it can even scale to enormous layouts with thousands of instances and stay efficient.

    So does that mean, in theory, if I do a for each enemies, I should create a Boolean that says “Exists” and check that first before the for each? (And Exists would always be true, but it would stop the for each from checking objects that don’t exist)

    Hopefully that makes sense? I’m only asking because I remember seeing a tutorial on the subject (that I would have to do some digging for) that stated that checks with families checked for every sprite in the family even if they didn’t exist in the layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm a bit curious about a specific scenario.

    Let's pretend you have two families; "playerProjectile" and "enemies". Now, let's also pretend each of those families have over 200 objects in each of them. When you do a "for each" loop on say, <is playerProjectiles overlapping enemies>, does it have to check for every single instance of that family even if 99% of the sprites aren't even in the layout?

    If this is still the case (I believe it was in C2, hence my asking), what would a way around this be without having to manually do overlap checks (or other random things)?

  • If I understand correctly I would just set the array value to “100,200,Player”

    Create object by name of <tokenat(arrayXYZ, 2, “,”)> at location <tokenat(arrayXYZ, 0, “,”)> and <tokenat(arrayXYZ, 1, “,”)>

    Hopefully that makes sense?

ome6a1717's avatar

ome6a1717

Member since 12 Feb, 2013

Twitter
ome6a1717 has 3 followers

Trophy Case

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

Progress

13/44
How to earn trophies