Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import bge
  2. from bge import logic as g
  3.  
  4. def save():
  5. s = g.getCurrentScene()
  6. pos = s.objects["player"].position
  7. rotP = s.objects["player"].worldOrientation
  8. rotC = s.objects["player_camera"].localOrientation
  9.  
  10. g.globalDict["pos"] = [pos.x, pos.y, pos.z]
  11. g.globalDict["rotP"] = rotP.to_euler()
  12.  
  13. g.globalDict["rotC"] = rotC.to_euler()
  14.  
  15. print("SAVED")
  16.  
  17. def load():
  18. s = g.getCurrentScene()
  19. s.objects["player"].position = g.globalDict["pos"]
  20. s.objects["player"].worldOrientation = g.globalDict["rotP"]
  21. s.objects["player_camera"].localOrientation = g.globalDict["rotC"]
  22.  
  23. print("LOADED")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement