Commit c0b3ab54

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.

Commit 3cb74acd

– 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.

Commit 80dee2b9

add a mechanism to switch between the bare bone game modes (simulation kind of works, shop is not doing much useful and build is a complete stub)

This adds the concept of “game modes”, which means three separate modes in which OLives can run now. The first, and default, mode is the simulation mode. In this mode you now can

  • Pause/unpause the simulation
  • Select/unselect non-static objects
  • Set a target for a selected object to move to

In the second mode, shop mode, you can

  • Select/unselect static objects
  • Nothing else yet

but you cannot pause/unpause the simulation, as it automatically gets paused when entering a non-simulation mode.
In the third mode the build mode you can do

  • Absolutely nothing

That’s still to come.
The different game modes can be switched by hitting F1, F2 and F3 respectively.

Commit e79e41b8

visually distinguish selected objects

This draws the selected objects slightly brighter than non-selected ones, and brings the last few commits to a conclusion, as we are now able to distinguish between clicks on objects, walls and tiles as well as being able to tell which entity has been clicked on specifically.
In the case of objects this is wired up to the existing “move object towards a given position” code in order to give the user the possibility to actually alter the game world, check out the video to see this what it actually looks like at this point.

Commit f4ea434f

– implement basic setting of movement targets for objects
– impelemet basic tile click handling (sic)
– add stub for wall click handling

This adds handlers for our three types of clicks (object, tile and wall) to the GameState. This furthermore adds the concept of “being selected” to the objects.
Once you click on objects you can now select them (if they are not marked as static) and set a target for them to move towards to.
This finally allows the user to actively alter the state of the world.