Blender game writting in Python.

Many people in here don’t know any python scripting for the game engine. Python scripting in the game engine isn’t only usefull but also cleaner. Inmagine yourself creating the full controls of a character for your game, afther some adding of logic bricks, it gets messy. With scripting you solve that problem.

My idea behind this topic is creating a game with as much python scripting as possible and less logic bricks. I’ll post a beginning I created, people can download it, change the python code and reply there changes. Afther each python code line the scripter has to add # with the info what the piece of code does. So when beginners take a look at it, they can see how it works.


  • add code to txt files, not inside blender.
  • adding code, and explain it with #info about code and/or comments.
  • less seperated scripts as possible, try to put as much in one text file.
  • keep the blend file as clean as possible.
  • solve errors before replying your addition.
  • when replying, make list what you added, fixed or changed.

The idea behind it:

  • learn game python to beginners
  • create a python game and check if python is faster then logic bricks
  • show power of game python

Python game.
Has scripts for:

  • forwards, backwards, left and right movement, jump
  • error logger, prints errors to txt file

scripts to add:

  • movements when on ground, disable when in air
  • shoot a bullet
  • turn sensors and key strokes into python (possible ??)
  • camera following character, also on slopes.

To fix:

  • going trough walls, replace Dloc, Drot with another motion

File can be found here:

Yeah, don’t use drot. My comp runs the demo insanely fast, and the cube spins at like 500 rpm LOL.

I’d suggest you take a look at [and possibly modify for your purpose]:

JD multi, this is a great idea!! Very intelligent!

And for people like me it is better to learn than steal python from other people’s .blend files.


that’s a great idea JD multi,maybe i can learn python through this thread.
thanks. :smiley: