Simple pause/resume button

Hello guys. im still in progress of learning in blender. this is my simple work in pause and resume game button:D Sample.blend (438 KB) …

i want to enhance my skill in blender using python. may you help me to add python scripts in my pause and resume button? :smiley: thanks

Use an overlay scene to suspend and resume the other scenes. Check the scene actuator.

I did a few changes to your blend

  1. Renamed the objects in the scene (The object names didn’t match the ones addressed in the python code)
  2. Switched the python controller to module mode and rewrote the python code (That way you can place multiple functions inside one script and access the controller directly via the “cont” argument
  3. Added an overlayscene “Masterscene” with the corresponding pause / resume logic

You can pause and resume the scene by pressing the spacebar.
Sample.blend (450 KB)

Is saw you used dloc for movement. That way you “teleport” the object by the given amount of blenderunits ignoring the physics system which causes the playerobject to bounce off the walls since it gets teleported inside the obstacle.
I replaced the dloc with livV which adds a constant force to your player object.

i created this resume.blend (460 KB) with an overlay scene, resume and quit button shows if you press ‘R’. may you help me to code this :smiley: thanks
i want to learn the coding in blender …

I clicked resume, Blender crashed!

sir! its working. change the scene.001 to scene and try to play it ;D

sir may you help me to create a code for that?