1 min
The fourth CGD blog post about Don’t Walk By
This week I added a camera touch system to the touch manager script as well as implementing a script to manage and spawn the pawns (previously called students). I also made a start on the density grid system.
The camera system works by the user touching with two fingers and dragging to move the camera around the scene. In order for this to happen however the touch manager needs to detect when a touch occurs even when its touching nothing. This is simply done by checking whether each current touch and seeing if they’re within a dictionary of touched gameobjects and touches. If there are at least two touches not touching any gameobject then it is a camera touch.
The pawn manger script primary function is to spawn the pawns in. I implemented a data driven system that can spawn pawns in up to an amount with intervals between each spawn. The pawn manager also holds a list of all the pawns that have spawned in, this allows users to reference that when handling the pawns instead of using FindGameObjectsWithTag
which can reduce performance if done every frame.
I also started implementing my density grid system. What this does is create a 1d array of floats as grid spaces and then find each pawns grid space using the pawns list from the manager and for each space a pawn is in increment the float in that array position.
Subscribe to this blog via RSS.
C++ 30
Directx12 11
Mario kart 11
Commercial games development 15
Unity 15
Low-level programming (19) C++ (30) Text based adventure (5) Ex-machina (9) Game engine programming (11) Directx12 (11) Mario kart (11) Land of gold (5) Audio visual production (1) Commercial games development (15) Unity (15) Don't walk by (15)