
26. Rename to Movie.py
- Text Editor menu >> Name box
Note:
- You don't have to rename it Movie.py
- You can leave as Movie.txt

27. Add an Always Sensor to the Movie_Screen
-
Select the Plane named Movie_Screen
-
Logic Editor >> Sensors >> Add Sensor >> Always
-
Activate TRUE level triggering (pulse mode)
Note:
-
You don't have to use an Always sensor. You can use any sensor you want.
-
Movie.py needs to be run with every frame.
-
Activating TRUE level triggering runs Movie.py every frame.

28. Add a Python Controller
- Logic Editor >> Controllers >> Add Controller >> Python
- Execution Method: Script
Note:
- You need a Python Controller to run a python script

29. Select Movie.py
-
Logic Editor >> Controllers >> Python Controller
-
Script >> Script List >> Movie.py
Note:
- Earlier, we opened Movie.txt in the Text Editor
- That added Movie.txt (named to Movie.py) to the game engine's python script list

30. Add a game property to Movie_Screen
- Logic Editor menu >> View >> Properties
- Properties tab >> Add Game Property button
Note:
- We are adding the material name and the movie name/path as python variables (game properties).
- This way we can use one (and only one) python script for all the movie screens in the game.