Lumino
by Lumino

Simple 3D Horror Game

Start with this template
67
from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8080)
Get full code

Simple 3D Horror Game

Created: | Last Updated:

Here's a step-by-step guide for using the Simple 3D Horror Game template:

Introduction

This template provides a basic structure for a first-person 3D horror game using WebGL and Three.js. The game features player movement, a flashlight mechanic, and random jumpscares.

Getting Started

  1. Click "Start with this Template" to begin using this template in the Lazy Builder interface.

  2. Press the "Test" button to deploy the application. This will launch the Lazy CLI and start the deployment process.

  3. Once the deployment is complete, you'll receive a dedicated server link to access the game.

Using the Game

When you open the game link in your browser, you'll see a 3D environment with trees. Here's how to interact with the game:

  • Click on the game window to enable mouse control for looking around.
  • Use the WASD keys to move:
  • W: Move forward
  • A: Move left
  • S: Move backward
  • D: Move right
  • Press the Spacebar to jump
  • Press F to toggle the flashlight on/off
  • Hold Shift to sprint (limited by stamina)

The game features a dark, foggy environment with randomly placed trees. You'll hear ambient sounds and footsteps as you move. Random jumpscares will occur periodically, displaying a scary image and playing a sound effect.

Customizing the Game

To customize the game, you can modify the following elements in the code:

  1. Adjust game parameters:
  2. Change moveSpeed, sprintSpeed, jumpForce, or gravity to alter player movement.
  3. Modify mapSize and numberOfTrees to change the environment size and density.
  4. Adjust fogNearWithoutFlashlight and fogFarWithoutFlashlight to change visibility.

  5. Replace textures and sounds:

  6. Update the URLs for ground texture, tree textures, ambient sound, footstep sound, flashlight sound, and jumpscare image/sound to customize the game's look and feel.

  7. Modify the jumpscare behavior:

  8. Adjust the minDelay and maxDelay in the scheduleJumpscare function to change the frequency of jumpscares.

Remember to test your changes by pressing the "Test" button after making modifications to ensure everything works as expected.

Integrating the Game

This game runs as a standalone web application. To integrate it into a website or share it with others:

  1. After deployment, Lazy will provide you with a dedicated server link.
  2. You can share this link directly with users who want to play the game.
  3. To embed the game in a website, you can use an iframe. For example:

```html

```

Replace YOUR_LAZY_APP_URL with the actual URL provided by Lazy after deployment.

By following these steps, you'll have a basic 3D horror game up and running, which you can further customize and share with others.

Technologies

Flask Flask
HTML HTML
Python Python
Javascript Javascript