I’ve been searching for a script to scroll the screen according to the mouse movement, and I found this:
import Rasterizer
controller = GameLogic.getCurrentController ()
owner = controller.getOwner ()
mouse = controller.getSensor (“mouse”)
margin = 20
if hasattr (owner, “x”) :
xPosition = mouse.getXPosition ()
if xPosition < margin :
owner.x = owner.x - owner.speed
if owner.x < 1 : owner.x = 1
elif xPosition > Rasterizer.getWindowWidth () - margin :
owner.x = owner.x + owner.speed
if owner.x > 11 : owner.x = 11
if hasattr (owner, “y”) :
yPosition = mouse.getYPosition ()
if yPosition < margin :
owner.y = owner.y - owner.speed
if owner.y < 1 : owner.y = 1
elif yPosition > Rasterizer.getWindowHeight () - margin :
owner.y = owner.y + owner.speed
if owner.y > 11 : owner.y = 11
But, as the file was in Deustch (I think), I could not understant it very well.
Does someone know how to help me? How can I use this script?
Also, about selecting units, is there a tutorial for that?