Ben's blog
Software development, games, and all that jazz
Home
Archive
Posts
Pages
Search:
Edit Post
Title:
Body:
<p>Tonight I added those raisable buildings I was talking about. This involved a lot more work than you'd think! Mostly this was because it's quite a radical change from the way things are done currently. Each building is made up of several meshes now - a ground floor, a roof, and several middle floors, whereas before there was the assumption that there was a 1:1:1 mapping between building, physics object and mesh.</p> <p><a href="http://www.flickr.com/photos/38367409@N02/3538791994/" title="High-rise buildings by b.hymers, on Flickr"><img src="http://farm4.static.flickr.com/3324/3538791994_4c584905bc.jpg" width="500" height="375" alt="High-rise buildings" /></a></p> <p>You may also notice that I've thrown some random rotations of buildings into the mix. This pretty much came for free when I was adding in all the other stuff, so I'm happy since it makes things look a whole load more interesting! Similarly, it'll now be easy for me to add things like stilts/foundations to make sure buildings don't hover like they can now, or to add scaffolding temporarily just after construction, or to change the appearance of buildings entirely (make them more futuristic as the game progresses or the buildings are developed enough). All graphical niceties that I'll get to in time!</p> <p>Unfortunately I've broken the physics on those buildings since they can no longer just take their position and orientation from their physics component (otherwise the whole building would be at ground floor level), but I haven't bothered to fix this since that's next on my list of things to revamp. I'll make buildings spawn 'building chunk' objects when they collapse, which will improve things in many ways - the Building class will then have one responsibility rather than two (it currently has states for 'free' and 'attached', the 'controlled' state being lost when I factored that out into the 'Piece' class), there will be the possibility for multiple building chunks with different graphics to that of the building they came from (proper bits of rubble!), and the Building object will need physics only for collision detection and not to physically attach it to the island.</p>
Tags:
cities-in-the-sky
Body markup:
Plain Text
Textile
HTML
Markdown
ReStructuredText
Draft: