Don't Walk By - 14

Don't Walk By - 14

Apr 24, 2020. | By: Evan Diamond
1 min

The fourteenth CGD blog post about Don’t Walk By

Overview

This week I added to the bus drop of system.

Bus Drop off system addition

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.

bus on stop

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.

bus off stop

About

Gamers developing new games.

Social Links

Our Bunker

University of the West of England,
Frenchay Campus, Bristol, BS16 1QY,
United Kingdom.