I’m trying to make a small city building game. I’ve made it so you click to add a building but how would I make it so you have to have enough money before you can? A keyboard sensor adds one to the property “money”. I’ve got this code in a python controller connected to an always sensor and a message actuator.
cont=GameLogic.getCurrentController() own=cont.getOwner() #get property money=own.money #get actuator sendMoney=cont.getActuator("sendMoney") #set subject sendMoney.setSubject("money") GameLogic.addActiveActuator(sendMoney,1)
the other object is an empty and a cube with a left click, mouse over, and message sensor set to 3. It has an and controller and an add object actuator.
If money=3 and I click on the cube it should add a building but it doesn’t, Why?
I hope this was clear, I’ll post a .blend if you need it.
Thanks in advance.