Monday, February 10, 2014

Zity - Physics and Lights

Hello anyone and everyone. Things have been moving a little quicker now that I'm back into my normal routine. I've worked on some of the physics and lighting a bit more on the main menu and thought I'd share. As of a few minutes ago I've implemented vehicles using the wonderful Farseer Physics Library (Almost a direct port of Box2D). I had been using Farseer for awhile but this is the first major structure I've created. The vehicle has four functioning wheels (until I work on Semi trucks) and headlights and physics governing it's movement and collision. Below is a screenshot:
(Zombies are all gathering around the mouse, the car is controllable)

I've also added lighting to the main menu in the form of random colored lights speckled around the screen, a light that follows the mouse, and the headlights. The car starts out positioned so you can see the menu in it's lights. So far the whole thing runs 60+fps on my decent-enough laptop (and in debug mode) so I'm not concerned with anything yet except a few physics glitches with the zombies colliding with the car. My plan is to finish up the vehicle class by adding brakes, player capacity, turning on and off, and switching gears (going to drive, park, neutral). Then I'm going to work on making it flexible enough that to add a new car I would simply create the image of the car, figure out where I want the lights, tires, etc.. and then use those values to initialize it.

All-in-all I'm very excited about this. This has probably been the most content that I've crammed into the game in a long time and it's starting to turn from a bunch of systems and code libraries into a game. There's going to be a lot of fiddling and tweaking along the way but I'm still very much a believer in the end product of Zity.

No comments:

Post a Comment