How do I create toggle signals

  • Hallo there

    Imagine a landscape, green grass, birds singing and train malfunctioning train signal

    I've got a "train" game that uses the tile map and lack of collision polygons as the track. The train uses pathfinding and by tweak the cell sizes and pinning a solid object behind the train which is an obstacle my train move forward (and only forward) i.e. doesn't rotate and turn around into the carriages.

    This all works.

    Now I have a problem that some "track" are one ways only, I achieve this by having a sprite pair acting as signals, once a train triggers the one way it's not available to other trains, once the train exist through the signal the signals toggle.

    I do this by means of enable \ disable the solid behaviour. It also works nice. (unless some train triggers it by accident but will cross that bridge still).

    My problem and question however is that the signals are in pairs which maybe I could do with containers however, one should always be opposite of the other like spins!

    Is there a smart way to toggle their settings without "hardcoding" it.

    TIA

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)