implement selection rotation
Now we also allow to let the current object selection be rotated in shop mode by middle-clicking.
Ramblings about hobbyist game development
implement selection rotation
Now we also allow to let the current object selection be rotated in shop mode by middle-clicking.
when determining whether a position is valid also take existing objects and walls into consideration
So far the only consideration was if the object is outside of the world boundaries. Now we also check for objects (and their dimensions) as well walls to determine an object can or cannot be placed.
improve the tile state hash function
In hindsight it is unfortunately a little hard to figure out how that is actually better. It certainly looks better!
– better (not perfect) hashing technique for selection indicator states
– rudimentary static object movment
– implement the first criteria of object placement (within the world coordintes), show a visual indication if it fails
(sic)
Coming back to more feature oriented work, we finally bring the pieces together and the passive selection is now used to move objects in shop mode.
The only constraint for placing an object for now is however the actual size of the logical world, so you can happily move objects on top of other objects or through walls.
Be that as it may, check out what it looks like!
move more types to the types namespace
Slightly bigger than the last one, but no functional changes.
move the vertex struct to the types
Just a small refactoring.
Rename the way too generic sounding Position class to NavNode
That sounds like a good idea!
Big refactoring: replace (hopefully all) arbitrary direct usage of glm vectors, raw values and std::tuples wherever sensible
While internally still using glm data structures, they are no longer being used directly, but rather as wrappers for other types to increase type safety.
add support for setting special colours on any tile (selection indicator WiP)
The new concept of passive selection is now to determine where to place an object after it has been selected in shop mode. To make the process apparent to a user, it can now change the render data of the floor tiles and add arbitrary colours to be superimposed over the texture information.
– add support for passive (hovering) selection of what is under the cursor in SHOP mode
– add support for selecting a tile regardless what’s on top of it (wall or object) when selecting something to be moved in SHOP mode
This adds the concept of “passive selection”. That means that the same mechanism is triggered as when the user actively clicks a tile. This is used to actively track the currently hovered entity (tile, wall or object), as this is a somewhat expensive operation, it only happens once every 20 ticks.