Arno De Keukelaere

Game Developer

arnodekeukelaere@gmail.com

Sweet Deceit

 

A puzzle game where your play a lost trick or treater trying to collect candy.
Explore a Halloween themed cube world and find your way back home.

 

This was a prototype based on Nintendo's Captain Toad: Treasure Tracker made in Unity (C#). Finished after 3 months of development, 8-10 hours spent working each week in between other classes.

Contribution:
As a programmer on the team I worked on: player, camera, pickup, menu, bomb, UI and UX functionality.

 

Applications used:

Visual Studio 2015, Unity, SourceTree, Photoshop, Audacity, Bfxr, Trello and Slack.


Team
:

Bram Deleay and Nick De Breuck.

Download mirrors

Screenshots

Code snippet(s)

Bitbucket repository

/*
Camera(C#):
This third person camera was created by playing and referencing footage from Captain Toad.
*/

// Reset the camera on button press, this resets the camera to it's initial rotation and zoom state.

if (Input.GetButtonDown("Camera Reset"))

{

Zoom = false;

_newRotation = _initRotation;

}

// Focus behind player on button press, this pulls the camera behind the back of the player.

if (Input.GetButtonDown("Camera Focus"))

{

_newRotation = _playerTransform.localRotation;

}

// Rotate by a specific amount of degrees

float rotAxis = InputStateManager.Instance().InputAxisCameraRotation;

 

if (_isRotating && rotAxis != 0)

{

_isRotating = false;

if (rotAxis < 0)

{

_newRotation = Quaternion.AngleAxis(
_degreesToRotateBy, Vector3.up) *

_pivotTransform.localRotation;

}

else if (rotAxis > 0)

{

newRotation = Quaternion.AngleAxis(-_degreesToRotateBy, Vector3.up) * _pivotTransform.localRotation;

}

}

if (rotAxis == 0)

{

    _isRotating = true;

}

 

// Zoom

if (Input.GetButtonDown("Zoom"))

{

    // Toggle zoom

    Zoom = !Zoom;

}

if (Zoom)

{

// Set camera speed

_cameraSpeed = _cameraSpeedZoomed;

// Set zoom via FOV

_mainCamera.fieldOfView = Mathf.Lerp(_mainCamera.fieldOfView, _zoomFOV, _lerpSpeed * Time.deltaTime);

// Set camera offset

_mainCamera.transform.localPosition = Vector3.Lerp(_mainCamera.transform.localPosition, _zoomMainPos, _lerpSpeed * Time.deltaTime);

// Set camera position to player

_pivotTransform.position = Vector3.Lerp(_pivotTransform.position, _playerTransform.position, _lerpSpeed * Time.deltaTime);

}

else

{

// Set camera speed

_cameraSpeed = _initCameraSpeed;

// Reset zoom via FOV

_mainCamera.fieldOfView = Mathf.Lerp(_mainCamera.fieldOfView, _initFOV, _lerpSpeed * Time.deltaTime);

// Set camera offset back to initial

_mainCamera.transform.localPosition = Vector3.Lerp(_mainCamera.transform.localPosition, _initPositionMain, _lerpSpeed * Time.deltaTime);

// Set camera position to zero

Vector3 newPivotPos = _initPositionPivot;

if (_usePlayerYPosition)

{

// Subtract player's y position if boolean is true

newPivotPos.x = _initPositionPivot.x + _playerTransform.position.x / 2;

newPivotPos.y = _initPositionPivot.y + _playerTransform.position.y / 2;

newPivotPos.z = _initPositionPivot.z + _playerTransform.position.z / 2;

}

_pivotTransform.position = Vector3.Lerp(_pivotTransform.position, newPivotPos, _lerpSpeed * Time.deltaTime);

}

 

// Get axis

Vector2 axis = InputStateManager.Instance().InputAxisCamera;

 

// Clamp y axis values

if (_mainCamera.transform.position.y < -_maxCameraY)

{

axis.y = Mathf.Clamp(axis.y, 0, 1);

}

else if (_mainCamera.transform.position.y > _maxCameraY)

{

axis.y = Mathf.Clamp(axis.y, -1, 0);

}

 

// Calculate all the stuff

Quaternion xRot = Quaternion.identity;

Quaternion yRot = Quaternion.identity;

if (TransitionManager.Instance().IsTransitionFinished())

{

xRot = Quaternion.AngleAxis(axis.x * _cameraSpeed * Time.deltaTime, Vector3.up);

yRot = Quaternion.AngleAxis(axis.y * _cameraSpeed * Time.deltaTime, Vector3.right);

}

// Set rotation

if (axis.x != 0 || axis.y != 0)

{

_pivotTransform.localRotation = xRot * _pivotTransform.localRotation * yRot;

_newRotation = _pivotTransform.localRotation;

}

else

{

// Lerp

_rotation = Quaternion.Lerp(_pivotTransform.localRotation, _newRotation, _lerpSpeed * Time.deltaTime);

_pivotTransform.localRotation = xRot * _rotation * yRot;

}

 

Copyright @ Arno De Keukelaere 2019. All rights reserved.