Fix reducing the wall draw height when placing new walls
Fixes this regression that happened.. sometime?
Ramblings about hobbyist game development
Fix reducing the wall draw height when placing new walls
Fixes this regression that happened.. sometime?
move more UI update code into the passive update() function
Streamlines things and makes things ready for more complicated use-cases
– remove dead code
– do not allow to replace a type with itself and still charge the user
– always check the available funds to ensure no unsingned int wraparound (sic)
Exactly as it said on the lid!
– add prices to wall and floor tiles
– change the way we update the UI (do everything passively in one place now)
– find a somewhat better hashing technique when calculating the UI hashes of containers when taking their children into account (workaround for collisisions)
Not just objects have prices now! The last part was particularly nasty, as containers that had the same type of contents would return the same hash, which was.. less than ideal.
– add the object id to objects
– also remove the texture path mapping when removing a texture
– increase the funds by half the original price when removing an object (“sell it”)
The first two were some background work to make things a) more manageable and b) try to not leak memory.
As for the bit of game play, check out the video:
– redo the way we update the UI from the game state and only have one entry point for it
– add the concept of prices to object types
– show the price when buying an object and only allow for placement if there are sufficient funds
There were multiple ways to update the UI before, some of which would have made it very complicated to update the display of the funds.
We also add prices to the object defintion files and lastly also add a check and subtract funds when the user places the objects, effectively changing it to “buying” them.
add missing asset files
Whoops!
– add a UI for the wall draw mode
– add UI for the current funds
– add a rudimenteray concept of current funds to the games state
This introduces the concept of “funds”, which already resides in the GameState and could be updated, but nothing is done with it yet.
As far as the wall draw mode is concerened, check out this video:
replace the “reset position” function on the camera with “set position”
This will make it easier to use it for different purposes down the line.
– slightly change the keymap
– make the zoom controllable via the mouse wheel
– make the rotation snappier by adding a reset behaviour similar to the scrolling when changing direction
After improving the scrolling it was also time to revisit the rotation.