Random scene/anime texture/mask/countdown

Hi, I would like to
-set a scene randomly between a set of scenes,
-anime a texture(make it progressively darker) in the game engine
-add a mask on certain scenes sothat I could see trough an image with the mouse
-Send the leftover of my countdown(for a quizz) in order to calculate a score(addition of all the remaining times)

Is there anybody who went through this and can help me?

Thank you!

You need a list of all the scene names that you want to use ej:
randscenes = [“MyScene1”, “MyScene2”, “MyScene3”, “AnotherScene”]

Then you select randomly one item form that list (you need to import random first):
scenename = random.choice(randscenes)

Then you change your scene with the new one. To that you must first get your scene, if it is the same from the object where you’re calling the script you can do that with:
scene = logic.getCurrentScene()
scene.replace(scenename)

-anime a texture(make it progressively darker) in the game engine

“Animate a texture”, is not what you want to do. What you want to do is change the alpha chanel of the object material. To do that make sure to enable Vertex Color on the material, then you can change the color on the object properties (Make sure to enable Alpha blend too). After that you have 2 ways of doing it, using a python script that progresively changes the alpha chanel (obj.color.w -= 0.01) or with the usual animation tools of blender and then using (obj.play(“NameOfTheAnimation”)) or playing it with a logic brick.

-add a mask on certain scenes sothat I could see trough an image with the mouse

Well this is untested territory for me. I think that for that you should use 2 textures on the same material, make one of the use Alpha and not Diffuse and then tweak with the matrial properties (Probably with alpha blend and Trasnparecy->Mask).
To move it with the cursor I have no idea. Probably you can do it with a shader but I don’t know.

Oh by the way, you can also just use a transparent texture with a whole in the middle if that’s what you want. An then move the object with the mouse.

-Send the leftover of my countdown(for a quizz) in order to calculate a score(addition of all the remaining times)

Send? Where? To a file? To the screen? To the net?