Game Programming

Working Collisions and BuilderScene Modifications

by Cory on September 25, 2018 10:13 AM (Edited September 25, 2018 10:19 AM)

After I added those extra conditions, I added more platforms to play around with and then a new system to move the camera around based on where the player character sprite is. I'm using a new component with the system called a "CameraAnchor" that tells the system which entity to follow with the camera. It's just quick code now but I can add more code later so that if there are multiple camera angles the system can do like a smash brothers type thing where it zooms out, or follows the "center of mass" between camera anchors, or does a mario bros type thing where it follows player 1. The limit is your imagination!

It's still not perfect though. I have a kludge in place to handle what happens when you collide with multiple objects in the same frame. I just add the response vectors together, but you can still get weird behavior (not pictured above). To fix this, I'd need to do a real broad phase and probably some kind of iterating constraint solver thing. I don't want to get into it right now because this is good enough for a vertical slice. But I think it will be fascinating when I come back around to it.

The next thing I want to do is add in a background, but I have to prepare a new tileset for that. The raw texture is complete enough.

I just need to populate a tilemap text file and stuff it into the Megaman Scene. Of course, because that would be too easy, I decided to beef up the BuilderScene code so that I can select between different text files and change tilesets. Of course, this means I need to load files and get UI elements set up for it if I don't want to hardcode it. I also had to move the tileset palette into the text file, which was also a lot of modifications.

I made code to create panel and button widgets.

There's a menu bar at the top now and a single experimental button. Currently it does nothing but changes color when you hover over it and click on it. Eventually this button should bring up a prompt that will let you specify a filename to load data from. I need to work on that next.

This Thought is part of Game Programming

Game programming general topic. I eventually hope to split this into separate ideas exclusively about specific games that I make.

back to the