A downloadable Sunday Night game

Source Code

Assets from Quaternius

A game by Angelo Davis

Programmed in C++ using Unreal Engine 5

Sunday night is a game about getting as much sleep as possible while your neighbours are making a noise! Chuck your furniture at the walls to shut up your neighbours and get some sleep in the fleeting peace.

How to play 

This game is best played with headphones. Use the spatial audio to find where the noise is coming from, chuck some furniture at that wall until your neighbour shuts up, then run back to bed quickly to get as much sleep as possible before the morning. You can only sleep with the light off!

Controls

WASD for movement
SPACE to jump
F to interact
LMB press to pick up
Release LMB to throw, RMB to drop.
Mouse to look

Project Highlights

Grabber Component

Source Code
This is a character component that handles grabbing, throwing and dropping physics actors using a physics handle on the character. 

A sphere trace was used to make it easier to interact with smaller objects such as the light switches.

The throw function adds an impulse to physics actors, this gives the impression of larger mass. as heavier actors will gain velocity inversely proportional to their mass. A maximum throw velocity was set so that small objects don't reach the speed of light. This imitates human's ability to throw because we have a maximum velocity at which we can move our arms. 

The grabber has been made configurable by exposing all the variables in the header file. 

The functions throw, grab and drop have been made public so that they can be called from the character class where the input actions are bound.

Character

Source Code

The character component handles input actions from the player for movement, hovering over intractable actors and interacting with interactable actors in the interactable trace channel. 
Right now I also have the gameplay loop attached to the player because this was the quickest way to do it at the time. Really, this needs moving to an actor dedicated to running the gameplay loop. 

Physics Prop

Source Code

Physics actor that is in the same collision channel as the grabber component and plays a sound on collision.

Noise Maker

Source Code

The noise maker is a collision box that plays spatial sound and detects the overlap of a thrown physics asset with a set amount of health, subtracted with each hit. When health goes to zero, the sound stops playing.

Bed

Source Code

The bed pawn allows the player to get into bed and sleep. The sleep function has the player possess the bed, seeing through the camera attached to the bed up at the ceiling. 

Bed actor
You might notice the sleep position scene component. Originally I was planning to lock the player position on top of the bed. I opted to possess the bed because it makes positioning easier and it leaves the Character standing in a safe position in the level.

Lights and Switches

Light Souce
Swich Source

The light switch casts to all ceiling light actors with the target tag, exposed in editor. This allows the binding of certain switches to multiple specific lights in the level. Because the lights work based on a toggle, you can also bind multiple switches to the same lights, allowing the lights to be controlled from multiple different switches.

The light switch gives the illusion of switching by rotating 180 degrees each time they are switched, flipping the switch direction.

Outlines

Outline Component 
Character 

Attaching an outline component to an interactable actors enables outlines.
The hoverOutlineInteractable function in the MyCharacter class handles hover detection and setting the outline state. 

Download

Download
SundayNight.zip 426 MB

Leave a comment

Log in with itch.io to leave a comment.