1 min
The fourteenth CGD blog post about Don’t Walk By
This week I added to the bus drop of system.
Originally when a bus would come in and stop on top the drop off tile. However this tile has now been changed to a bus stop sign and because of that the bus now stops on top of that sign.
This clearly needs changing.
To deal with this I needed to find a suitable spot to spawn the bus preferably the road where the stop would be by. To find this road I needed to know where the building was relative to the stop and then I could assume the road was on the other side. Firstly I got the vector between the bus stop’s position to the position of the nearest door’s position (I’m assuming the doors mean there’s a building) this is the direction from the stop to the building where the pawns will likely go. I then take this vector and find weather it is mostly pointing up, down, left, or right and take the opposite of that direction. I then take this vector and go through each tile from the bus stop’s tile in the direction of the vector. Each tile that is suitable for the bus to spawn on I store in a list until I reach an invalid tile. I then use the middle tile of the list as the tile to spawn on.
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)