Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bge
- import mathutils
- import aud
- import time
- import mytools
- import statePlayer
- device = aud.device()
- sndPlrLossLife = aud.Factory.file(
- bge.logic.expandPath("//assets/music/smw_lost_a_life.wav"))
- p = bge.constraints.getCharacter('player_avatar')
- cont = bge.logic.getCurrentController()
- obj = cont.owner
- scene = bge.logic.getCurrentScene()
- marker = str(scene.objects['player_avatar']['spawnMarker'])
- respawn_marker = scene.objects[marker]
- detector_camera_pan = scene.objects['detector_camera_pan']
- detector_camera_pan_left= scene.objects['detector_camera_pan_left']
- game_scene = mytools.getScene(bge.logic.getSceneList(), 'game_world_level_1')
- if obj.worldPosition.z < -15:
- print('player fell of the world, respawning')
- obj.worldPosition = respawn_marker.worldPosition
- sndPlrLossLife = sndPlrLossLife.pitch(1)
- device.play(sndPlrLossLife)
- detector_camera_pan.worldPosition = obj.worldPosition
- detector_camera_pan_left.worldPosition = obj.worldPosition
- game_scene.objects['player_avatar']['health']-= 1
- statePlayer.collideWithEnemy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement