Skip to content

tannosukeee/Dont-Be-Scared

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Don't Be Scared

A first-person survival horror game built with Unity. You wake in a darkened apartment with something hunting you — flicker through the halls, find the pistol, ration your ammo, and escape before the dead catch up.

This repository contains the Unity game project and a website that hosts and plays a WebGL build of the game in the browser.


Repository layout

.
├── Don't be scare/        The Unity project
│   ├── Assets/
│   │   ├── Animations/     Doors, torches, pistol, screen fades
│   │   ├── Audio/          FX (door, pistol) and zombie growls
│   │   ├── Materials/      Walls, rock, fire, menu art
│   │   ├── Object/         Models: ammo box, apartment door, zombie
│   │   ├── Player/         Mini First Person Controller
│   │   ├── Scenes/         MainMenu, Scene1, CreditScene
│   │   └── Scripts/        Game logic (see below)
│   ├── Packages/           Unity package manifest
│   └── ProjectSettings/    Unity project settings
│
├── website/               Browser player for the WebGL build
│   ├── index.html          Landing page
│   ├── play.html           Game player page
│   ├── css/ · js/          Styling + Unity loader bootstrapper
│   ├── Build/              ← drop the WebGL build here
│   └── README.md           Website-specific build/run guide
│
└── README.md              This file

The Unity project

  • Engine: Unity 2022.3.27f1 (LTS)
  • Product name: Don't be scare
  • Key packages: TextMeshPro, Timeline, uGUI, Visual Scripting (see Don't be scare/Packages/manifest.json)

Scenes

The game loads scenes by build index, so order matters in File ▸ Build Settings ▸ Scenes In Build:

Index Scene Purpose
0 MainMenu Title screen / New Game button
1 CreditScene Shown after the play sequence (ToMenu loads index 1)
2 Scene1 The main playable apartment level

If scenes load in the wrong order, re-check the Build Settings list — the scripts reference indices directly (SceneManager.LoadScene(1) / (2)).

Scripts

Game logic lives in Don't be scare/Assets/Scripts/, organized by area:

Folder Script Responsibility
Player/ PlayerCasting Raycasts forward, publishes distance to targets
Weapons/ FirePistol Fires the pistol, applies damage, rate-limited
Weapons/ PickUpPistol Pick up the gun via the Action key
Weapons/ AmmoPickUp Ammo box trigger, adds to ammo count
Weapons/ GlobalAmmo Tracks ammo count, updates the HUD text
Enemies/ ZombieDeath Zombie health, death animation, cleanup
Environment/ DoorOpen Interactable doors
Environment/ FlameAnimation Random torch flicker animation
UI/ ToMenu Timed transition to the next scene
Menu/ MainMenuFunction Main menu New Game flow
Sequences/ FirstTrigger, CubeTrigger, CubeTrigger01, Sequences_01 Scripted scares and intro sequence

Controls

Input Action
W A S D Move
Mouse Look around
Action key (default E) Interact / pick up / open doors
Left Click (Fire1) Fire pistol
Esc Release mouse

Open and run in the editor

  1. Install Unity 2022.3.27f1 via Unity Hub.
  2. Open the Don't be scare folder as a project.
  3. Open Assets/Scenes/MainMenu.unity and press Play.

Play in the browser

The website/ folder is a ready-made player for a WebGL build of the game. Building WebGL requires the Unity Editor — it compiles scenes, assets, and C# into WebAssembly, so it can't be produced from the scripts alone.

Quick version:

  1. In Unity: File ▸ Build Settings ▸ WebGL ▸ Build.
  2. Copy the contents of Unity's output Build/ folder into website/Build/, named DontBeScared.* (or set BUILD_NAME in website/js/game.js).
  3. Serve over HTTP from the website/ folder:
    python -m http.server 8080
    Then open http://localhost:8080.

Full instructions, deployment notes, and troubleshooting are in website/README.md.

Unity WebGL must be served over HTTP — opening the pages with file:// will not work. Before adding a build, the player page shows a clear "No game build found" notice instead of erroring.


Testing

  • Website shell (no build needed): serve website/ and confirm the landing page, navigation, styling, and the "No game build found" notice all work.
  • Full game in browser: add the WebGL build, then verify the loading bar, input/mouse lock, controls, and fullscreen.
  • Gameplay logic: runs in the Unity Editor's Play mode — e.g. confirm the pistol is rate-limited to one shot per ~0.5s and that a zombie's death sequence plays once when its health reaches 0.

Notes

  • Library/ is Unity's local cache and is regenerated automatically; it should not be edited by hand (and is typically git-ignored).
  • The website is not affiliated with Unity Technologies.

About

A 3D horror game with a first-person perspective that can have fun with you.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors