Wheels and Carts - Physics movement

in Game Development3 years ago

Wheels and Carts

I've been sitting little time in front of the pc this last weeks, summer has started and is really hard to stay in front of a monitor sweating and getting nowhere with an overheated mind. But nonetheless I made something that I love playing around, I added wheels to this strange more physics complex world.

asdasdwdwd.png

Here a little showcase of the carts accompanied by a synths butchering the majestic Pictures at Exhibition by Modest Petrovič Musorgskij wich has been the soundtrack of these days, maybe for the cooling effect of these sounds from northen europe

The Code

effefe.png

Making this vehichles wasn't too hard, after a bit of studying the different kind of function dedicated to the creation of various parts and wich one suit better most of the work is done by making it spawn the wheels at the correct location and having mostly accurate collision shapes.

The above cart other then spawning the two wheels spawn even two barriers as seen here.

adadasd.png

The only difference from wheels is that it use the function physics_joint_weld_create instead of physics_joint_revolute_create wich allow the object to rotate around it's origin. Joint_weld make the object keep it's position almost glued, for this one I left it a bit more loose as it more fun and wacky to look at but is possible to make it almost completely firmupon collision.

efefe.png

Here's the wheel with simple moving comands using physics_apply_torque and having a high value in friction.

swdfw.png

Game ideas

Been having much fun running the cart around and even if I don't have a precise idea on what to develop next the path is to make a simple game where you control the speed of the cart on various terrain and protect it from flying dangers with the mouse pointer so that one can reach safe the next area.

To add a bit more of complexity I was thinking about adding an economic value to the goods you may transport on the cart, that if juggle well enough to the next market can be sold to raise the score or buy upgrades. This has been alread done by this fantastic and weird game but I would love to try a different spin on it!

feeff.png

https://store.steampowered.com/app/1581580/The_Legend_of_BearTruck_Trucker/

This sum it all up for now here some more footage from @threespeak with some juggling and a quicly improvised soundtrack with Fruity loops.

Have a good weekend Devvers!