How do I check weather I'm on track or grass?

0 favourites
  • 6 posts
From the Asset Store
Simple and easily editable template for a dynamic camera that zooms in and out based on how far apart the players are.
  • Hello everyone,

    I'm designing a prototype for a racing game, and made a track with grass around it (2 Inkscape layers, one for grass, another for track). Then, I exported the grass layer and the track layer to 2 png images, added them to construct and added a car w/ Car behaviour. In the events, I added a Is Overlapping Track to set the max speed of the car to 250 and not Is Overlapping Track to set the max speed to 80.

    Problem is: when it goes to the "hole" inside the track (transparent, so you see the grass layer), is still counts as the track overlapping.

    What is the best way of handling this? Will I have to add a shape in the inner boundaries of the track above it to slow it or is there a better way?

    Thanks in advance,

    Marcelo

  • short answer: Yes you'd have to add a shape

    longer answer: Using big sprites is probably not the best way and cutting them up into smaller pieces with collision-polygons would work much better..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you.

  • Another possible way to do it, though time consuming, is to divide the track sprites up into straights and turns, make a family out of them and piece them together to 'build' the track. That way, there will only be collision on track pieces.

  • Hey SeriouslyCrunchy - was trying that after reading your tutorials - which, if I might say, are awesome.

    Will try to follow this approach . Thanks for your reply.

  • Thanks very much! Always good to hear from those who are finding my tutorials useful!

    It does take a lot of time to place them all and align them, and it does mean you have loads of instances of the sprite objects, but it does mean the whole thing works much better than a single sprite in regards events and especially collisions.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)