예제 #1
0
파일: Town_Map.py 프로젝트: Lummock/Shooter
    # water.on_trigger_enter = Func(math, player.y += 1)

    globaltimer += 1
    localtimer += 1

    if held_keys['o']:
        player.y += 10

    if held_keys['i']:
        player.x, player.y, player.z = player.x, player.y, player.z


# player settings
player = FirstPersonController()
player.collider = 'sphere'

player.speed = 15

if mapp == 1:
    pivot = Entity(shape='sphere')
    world1 = DirectionalLight(parent=pivot,
                              x=10,
                              y=50,
                              z=200,
                              shadows=True,
                              color=color.rgb(150, 150, 150),
                              direction=(1, 100, 100),
                              shader=triplanar_shader)
    world2 = AmbientLight(color=color.rgb(125, 125, 125),
                          shader=triplanar_shader)
예제 #2
0
random.seed(0)
Entity.default_shader = lit_with_shadows_shader

ground = Entity(model='plane',
                collider='box',
                scale=64,
                texture='grass',
                texture_scale=(4, 4))

editor_camera = EditorCamera(enabled=False, ignore_paused=True)
player = FirstPersonController(model='cube',
                               z=-10,
                               color=color.orange,
                               origin_y=-.5,
                               speed=8)
player.collider = BoxCollider(player, Vec3(0, 1, 0), Vec3(1, 2, 1))

gun = Entity(model='cube',
             parent=camera,
             position=(.5, -.25, .25),
             scale=(.3, .2, 1),
             origin_z=-.5,
             color=color.red,
             on_cooldown=False)
gun.muzzle_flash = Entity(parent=gun,
                          z=1,
                          world_scale=.5,
                          model='quad',
                          color=color.yellow,
                          enabled=False)