Input - T3rabyte/Examen GitHub Wiki

Input systeem

Om het tijdens de game makkelijk te maken voor de spelers om te zien wat er op de monitoren gebeurt is er een script gemaakt dat de camera van de speler op een locatie zet die dichter bij het scherm staat. Later werdt dit script omgebouwd zodat er ook een audio object aangeroepen kan worden.

alt text

graph TD;
    start((Player presses mouse button)) --> buttonType{What mouse button did the user press?}
    buttonType --> |Left mouse button| check{Does the object the player aims at have a collider and one of the input tags};
    check --> |No| nothing(Nothing happens);
    check --> |Yes| type{What is the tag of the object?};
    type --> |Camera| camera(Sets the camera position to the position of the camera position child of the object);
    type --> |Audio| audio(Retrieves a random audio file from the audio clip list of the object);
    audio --> playAudio(plays the chosen audio from the object chosen);
    buttonType --> |Right mouse button| checkInObject{Is the camera in a objects camera position?};
    checkInObject --> |Yes| returnCam(Returns the player camera to the player model);
    checkInObject --> |no| nothingCam(Nothing happens);

Player controller

De player controller is een cruciaal onderdeel van onze game ervaring. Het stelt spelers in staat om vloeiend door de virtuele wereld te navigeren. Met de controller kunnen spelers lopen, rennen, springen in de game. Dankzij de aanpasbaarheid van de controller is het makkelijk om eigenshappen als de snelheid of de speler kan bewegen of roteren.