Dev Log - Day 5


Added sound to car

Added a CarSound class to vary the pitch of the engine based on how fast the car is going. I based my code on a video I saw. The sound is ok for this game, but it lacks the gear changes and the high speed is off, but sufficient for this game and dev time available.

Added SoundManager

A singleton class to play one off sounds like when a UI button is pressed or a pickup item is picked up.

Added UIManager

This will handle showing the UI at the top of the screen. It handles updating the text for the current car speed, score, showing a prompt when an item is picked up or dropped off. It also has a reference to the upgrade window.

Added properties for Speed of the car, to the car controller:

public float speedKph => theRB.linearVelocity.magnitude * 3.6f; // from m/s to km/h (60*60/1000)

public float speedMph => theRB.linearVelocity.magnitude * 2.2369362912f; // from m/s to mph

Added ui panels for a simple shop, so the player can upgrade their car. I thought this would be easier than selecting/buying a new car.



General Updates

Added some icons and sounds to the game assets. Added 3 icons for use as the shop button, I thought the game could pick one at random. I added a sound for the shop, it will be played when you don't have enough money and another when an upgrade is bought.


Added text to show the distance to target, below the car - it muddies the class but I decided to modify the PointAtTarget class for simplicity.

I made the box collider of the pickup and drop off items larger - twice the size. So they should be easier to hit now.

I modified the GameItemPickupSO Scriptable Object; I added fields for characters name, image and text.
     I also added a few fields to allow a mission to be finished within a time period (e.g. 10 seconds). If the passenger is in a rush, then this flag will be ticked, a time required to finish in will be set and also a points bonus set, which will be granted if the player finished in time. An example of an instance with the fields available is here:

This character when picked up will need to be delivered within 25 seconds to receive a 1000 point bonus. The player will get 2 points just for picking them up and 100 points for delivering regardless of whether the 25 second time bonus is complete. 



Generated some images for the passengers. These were made with: perchance


Ideas on text for the passengers to say

Passenger

Text
GrandmotherI'm off to see my grand kids, I baked them some nice warm oat meal cookies
PlumberMy darn van broke down, but I must get to a pre-booked customer
PlumberI 'ave a wee problem wit' a cus'omers rad. 'tis flowin' wa'er all over der floor. I bes' ge' over der quick.
PlumberAn important rich customer has a leaking pipe, I must get there quick. Medal to the Metal young fellow.
Business PersonI had a wee problem with dat darn car of mine, I need to get to the airport pronto or it'll be my hide outside
Business Person
I'm late, I'm late, I  have a presentation to make and I'm late. Please be quick.
Delivery PersonI'm late for my delivery, I can't lose my job, I have  cat to look after. Please get me there.
Delivery Person
I've an important delivery to make and my motorbike isn't starting, give me a lift and I'll walk back.
Cake MakerI got a flat tire on my bike and no time to fix it, I need to deliver this cake asap or the customer won't pay me.
Cake Maker
I need to get to apartment A to deliver this fresh cake
School boyI need to get back to school
School GirlHi Sir, plese take me to school. I'm excited to see my friends.
Guy on DateOh I'm so nervous, I have a date with a lovely lady, I've only a few minutes to get there, please hurry.
Lady on DateI have a date in 30 min, but thought I'd get there early.
Lady on DateHurry,  I have a date with like the best looking guy in town. It's gonna be like awesome.  
Guy After DateTake me home.
Lady After DateMen are such trouble, all that effort for nothing, I should've stayed at home.


WindowCharacterDialog

I created a simple CharacterDialog panel with an image of the character, their name and text for them to say


The WindowCharacterDialog class handles showing the dialog, setting the details and fading out when complete.

When you first pick up an item, the dialog will show and play the voice if one it assigned. When you've delivered the item/passenger the characterDialogOnFinish text is shown, if none is specified then the dialog is not shown.

Leave a comment

Log in with itch.io to leave a comment.