silkc2's Recent Forum Activity

  • Did you try my capx?

  • "On overlap" should only fire once whereas "is overlapping" will be true as long as they overlap. Which are you using?

  • Well this is a blatant case of me cheating but see if you can take this idea further.. basically abuse animations to set different collision areas, one allows them to pass over one another, another makes them full blockers when near a player.

    dl.dropbox.com/u/116137178/Help/HelpWithColliders.capx

  • OK ignore me, it does work, total red herring hiding the real issue.

    Sorry 'bout that! <img src="smileys/smiley11.gif" border="0" align="middle" />

  • I've tried it exactly as above - two conditions in one event and then the pick nearest as a sub, I've also tried all three conditions in one event in the same order.. in all cases it's picking enemies that don't meet the first two criteria. I'll try knock up an example (not ready to share this game with the world yet, hehe).

  • Hi all

    I have set of events and they're not working like I think they should.

    FamilySprite Is overlapping "DeadZone"

    FamilySprite Health = 0

       FamilySprite Pick nearest to Player.x, Player.Y

    Here I expect it to only pick the nearest dead enemy in the deadzone, but instead it's picking from all the enemies on screen.

    I thought conditions filtered things but that doesn't seem to happen here?

  • Surely if you made the blocker angle towards the bullet and then move forwards (x pixels depending on what speed you want) on every frame, then it'd work as you want anyway?

    So every frame it would look for the bullet's current position and move towards it.

    Would work better if the blocker had it's origin in the middle, that way the edge of the blocker shape would hit the bullet earlier.

    Also you'll have to be careful about when you "pick nearest" cos if you do that every frame then the blocker will change his mind over and over about which bullet to head to. I suggest having a "TargetUID" instance variable on the blocker, set when a bullet is first in his range - so the first bullet that gets into range is what he will try to block. Once that bullet has gone, he will re-target the nearest again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I might have misunderstood therefore I might be over-simplifying..

    But there's already a "pick nearest" condition you could use?

    Cond: myObject Pick Nearest X=SourceObj.X Y=SourceObject.Y

    Would return nearest "myObject" to a source object.

  • I'd go back to where you started from with the physics and work out why it's being weird. It could be something simple like you have uneven sprite masks on your player animation frames.

  • Unless you can set me straight here..

    The problem with containers, and the prime reason I still haven't found a use for them, is that they can only be bound to one sprite, AND they can't be bound to a family.

    So I've got 50 different enemies, I'd have to create 50 unique collider objects and associate each.

    That's a bit of a design time nightmare and also uses way more memory than needed, so for now I'm going with what Whiteclaws suggested. Creating and pinning a "larger" collider sprite to a created family enemy at runtime.

    Then when the fade of my enemy completes I loop around all colliders, match faded Enemy UID to ParentID (instance variable I manage), and destroy the collider.

    If you have a more elegant approach using containers and I'm being silly and missing something, let me know!

    As for my request..

    I think if you had many masks you'd be able to check for collision to "any" mask which would be the default and look the same as the events look today.

    I think you'd additionally be able to check collision against a specific mask per sprite (just like you can reference the sprite's various animations by animation name).

  • Right so yeah, I can get it to work like this but it's finicky so I'll leave my request here as a "nice to have".

  • Yeah objects are animated.

    I'm experimenting with pin right now. As expected, works like a charm for detecting touch, but due to the lack of reverse lookup (i.e. My hitzone can get pinnedUID, but the object I'm destroying can't see what is pinned to it) then there's no elegant way to remove the "hit zones".

    So, I have two ways an enemy can de-spawn and in both cases I would need to identify and remove their pinned hit areas - can't see a tidy way to do it.

silkc2's avatar

silkc2

Member since 28 Jan, 2013

None one is following silkc2 yet!

Trophy Case

  • 11-Year Club

Progress

11/44
How to earn trophies