I’m doing my fist test with blender game engine and I have a question, I’m trying to do the “Simon” memory game (http://en.wikipedia.org/wiki/Simon_(game)) using blender, I have the gameboard and I’m trying to add the logic and the events, what I’m doing is add a couple of sensors (for mouse over and mouse click), a couple of controllers (an AND and a Python controller) and an actuator (type Sound to get the note and linked to the AND controller) but I have a problem with the Python part, I’m trying that when the user click a block it changes his colour, I’m trying doing this:
import bpy from bge import logic as G from bge import render as R owner = G.getCurrentController().owner owner.diffuse_color = (1, 0, 0)
but that does not work, searching in google I found that is possible change the colour of all the elements with this:
import bpy for item in bpy.data.materials: item.diffuse_color = (1,0,0)
and it works but the change of colour is not visible until I exit to the game (and change all the colours), so, my question is, how can I change the diffuse_color of the element that I clicked? is that possible? I attached an image showing what I have at this moment.