From f273c6675fb79a7d95305c55b45b92b63528f475 Mon Sep 17 00:00:00 2001 From: SirDank <52797753+SirDank@users.noreply.github.com> Date: Sat, 13 Jan 2024 23:22:42 +0530 Subject: [PATCH] Update dank.game.py --- __modules__/dank.game.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/__modules__/dank.game.py b/__modules__/dank.game.py index df2faef..e7835e3 100644 --- a/__modules__/dank.game.py +++ b/__modules__/dank.game.py @@ -2,6 +2,7 @@ from ursina import * from dankware import cls, clr, title from numpy.random import choice, randint +from ursina.scripts.smooth_follow import SmoothFollow from ursina.prefabs.first_person_controller import FirstPersonController cls() @@ -47,6 +48,7 @@ #player = EditorCamera() player = FirstPersonController(speed=2.5) +player_camera = Entity(parent=camera, position=(0.5, -0.5, 0.8), rotation=(0, 135, 5)) sky = Sky(texture='sky.png') world_size = 250 # n*2 x n*2 @@ -75,11 +77,11 @@ def enable_lighting(): - global torch scene.fog_density = 0.2 scene.fog_color = color.black - torch = Entity(parent=camera, model="flashlight.gltf", position=(0.5, -0.5, 0.8), rotation=(0, 135, 5), scale=0.3) - torch_light = SpotLight(parent=camera, color=color.white, position=(0.5, -0.5, -5), rotation=(0, 0, 0)) + torch = Entity(model="flashlight.gltf", scale=0.3) + torch_light = SpotLight(parent=torch, color=color.white, position=(3, 0.5, 4.2), rotation=(0, -135, -5)) + torch.add_script(SmoothFollow(target=player_camera, rotation_speed=10)) enable_lighting()