RattyRat's Forum Posts

  • Hi, just thought I would share a recent problem I have had, and the solution I found.

    The problem was that my game had multiple instances of a sprite object. The sprite was a rock and it was a physics object.

    Initially most rocks were set as 'Immovable', the idea was to have them block paths until they are moved by collision with other objects.

    Hence one of the events I needed to add was a Rock collides with Rock event, with the immovable rock becoming movable thereafter.

    Problem was I could find no way of acting on specifically the immovable rock in the action after the collision event. I tried assigning an instance variable 'Movable' but still had all kinds of problems. Either the collisions were detected immediately and all rocks become moveable, or the same rock would keep making itself moveable and the other would remain immobile. <img src="smileys/smiley6.gif" border="0" align="middle" />

    The solution I found was to create a new family, which I called "RockActivators", and put the rocks in it (and other objects that would make a rock moveable). The event then became RockActivators collides with Rock and thus it became possible to reference each object separately in the actions.<img src="smileys/smiley1.gif" border="0" align="middle" />

    It would be nice if there was a way of forcing 'Sleeping' on physics objects, which would sort this out for me. I will add that to my list of suggestions to be posted soon.

    Hope this helps someone out there...

    RR

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads