– 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!
Ramblings about hobbyist game development
– 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.
– improve/replace scrolling mechanics for a more consistent and snappy feel
– add a hotkey (C) to go back to the centre (coordinate 0,0)
The scrolling does indeed feel a lot nicer now.
The hotkey makes it a lot easier to do debugging, as leaving the OLives window always triggers scrolling and the user might be a bit lost when coming back to the window.
hide walls that have a used tile behind them, depending on the angle of the camera
Besides the set the walls to be “always up” and “always down” add a third mode, that automatically puts the walls down if they are on the “inside” of a building. The overly simple method to determine this is if a tile that is not just ground/grass is behind that piece of wall – depending on the camera angle looking at it: