I have a few questions:
- if I use a lot of sensors with pulse mode running all the time, am I going to use up too many resources?(what I’m using the pulses for)
Answer to 2 made this question irrelevant.
2. are “if” statements the proper way to change the color of something when I mouse over it?
what I used:
import bge cont = bge.logic.getCurrentController() own = cont.owner mouseover = cont.sensors["mouse over"] notmouseover = cont.sensors["not mouse over"] keyboardup = cont.sensors["up"] if notmouseover.triggered: print ("false") cont.owner.color = [1,1,1,0] if mouseover.triggered: print ("true") cont.owner.color = [1,255,1,0]
This is the proper way to do it:
import bge #use every time import mathutils cont = bge.logic.getCurrentController() #use every time own = cont.owner #use every time mouseover = cont.sensors["mouse over"] if mouseover.positive: cont.owner.color = [1,1,1,0] else: cont.owner.color = [0,1,0,0]
- where do I enter/attach python scripts that I want to run every time I start my game?
Answer: the camera is a good object to attach all your python scripts that you want to run when your game starts up