How do i make an efficient skid marks on my drifting game?

0 favourites
  • 4 posts
From the Asset Store
Awesome drifts on auto generate way,tap to steer right.
  • Só basically i am making a drifting racing game, and i want to make skid marks, so when my car is drifting it can be seen more clearly that the player is drifting

    the way that i did this is that on every tick that the player angle and the player moving angle are more than 30 degrees, it creates an sprite "derrapada" at two of the player image points located on the back wheels of the car and set those sprites rotation to be the same as the car moving angle

    it makes a very pretty effect, but after 1 lap, if the player is drifting okayish will be made about 2000 "derrapada" sprites(the sprites fade out after some time, so this number hardly increases more than that)

    for now, on my computer this doesn't have any noticeable performance loss,even on the worst case scenario with 2 players drifting together(the second player screen being rendered trough canvas plugin) but since i am thinking about expanding this mechanic a lot, i want to know beforehand if it can make frametime > fps

    since im thinking about making my game playable also on phones,adding this effect to enemy bots, and adding this to the four wheels i want to know beforehand:

    how much performance can be reduced by creating several instances of the same sprite? is it significant or negligible?

    is there any way to change the properties of the sprites to make then more efficient?if not, is there any other plugin that can create the same effect but more efficiently?

    is there any other good way of making skid marks without creating objects every tick for every wheel drifting on the scene?

  • If you don't necessarily need them to fade out over time, you can paste these sprites onto a Drawing Canvas and then delete the sprites. It will definitely be better for performance than having 2000+ fading sprites.

  • dop2000 isn't canvas heavy? because you are rendering stuff twice, also, how would that work? i didn't understand

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Canvas is not heavier than a sprite. And you only need one canvas object, not 2000 of them. So it will definitely be much better for performance than 2000 sprites.

    When you need to add skid marks, create skid marks sprites, paste them to the canvas, wait 1 tick, then delete the skid marks sprites. Here is a similar demo:

    howtoconstructdemos.com/splashes-of-paint-on-the-wall-c3p

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