Endless Driving (2D Sidescrolling Car)

I finally readjusted my sidescrolling car driving example to make use of the new Physics Joint behavior. The result has a bit less bouncy suspension than I would want, but it’s a tradeoff between that and having the wheels of the car able to fly all over the place upon colliding with the ground.
The ground is randomly generated by spawning a combination of square and round blocks.
Anyways, you can drive until your device is unable to run the game anymore due to there being too many ground objects spawned in (yes, they are disabled when offscreen and it still lags out eventually).

7 Likes

… The player is always trying to flip backwards.

Other than that, I LOVE IT ALREADY!

1 Like

Yeah, it’s supposed to make the car do a bit of a wheelie when you hold forward, but I may need to tone that down even more. Thanks for the feedback

1 Like

Try increasing the front wheel’s density, that might help.

Also, unless the car is rear-engine or a motorcycle, there isn’t much of a chance of doing a wheelie.

1 Like

True, I only created that mechanic in the first place because without it, the game was way too easy.

1 Like

Oh, I guess. It’s still very fun though!

1 Like

Thanks, and nice job getting the second place score!

1 Like

Thanks, but I don’t think 1st will last long.

1 Like

213,000.

1 Like

I got 8th place GG

1 Like

Wow, I couldn’t even get that far back before I added the tilting mechanic, nice job!

2 Likes

I had to go on an average of 20 Speed. I tried “Flooring it”, and I only got to 30,000.

Then what do you know, Jake beat me.

1 Like

I thought I was going to get the to win, but then I realized that all the other players had a digt on top of mine. :laughing:

3 Likes

Lol, welcome to my world.

3 Likes


These now exist

3 Likes

So now flipping gives you bonus points (though the system has some bugs and will occasionally think you flipped when you didn’t…but at least it works)


The amount of points you get for a flip scales with the difficulty you chose (easy=fewer points, hard=more points).

Also, I implemented a collectible fuel mechanic, so you lose if you run out of fuel. This is so that there is more incentive to actually keep driving forwards over the terrain (and to prevent someone from just repeatedly flipping when they find a convenient area)


You burn more fuel on hard difficulty and less fuel on easy difficulty.

Anyways, besides fixing the flip bug, I don’t have any plans to add more stuff to this game, since after all, it’s just supposed to be an example of what’s possible in Flowlab now. So feel free to copy anything here and make your own game out of it.

3 Likes

what about adding airtime?

1 Like

That’s a good idea; detecting if a wheel is touching the ground seems to be finnicky depending on how the car lands, but I’ll give it a shot…

You could use a proximity or two raycasts, one for each wheel?

1 Like

I’ve been using a Proximity, but if I make the check distance too short, it doesn’t always trigger when it should, and if it’s too long, then it starts becoming an inaccurate measurement of when the car is actually in the air.
In other words, I’m trying to find the right balance.
What did you have in mind with Raycast?

1 Like