← Back to team overview

sikuli-driver team mailing list archive

[Question #288063]: The crew PC game basic driving using arrow keys question

 

New question #288063 on Sikuli:
https://answers.launchpad.net/sikuli/+question/288063

hi, i just bought the crew on pc and want to do some very basic sikuli.

Here is what we all know
leftArrow  // steer left
rightArrow // steer right
upArrow   // accelerate
downArrow   // break

basically, I always press upArrow and when it reach higher than 60mph, I would decide to break, steer left/right
So how do I go about doing this?

caraccelerate = keyDown(DOWN)
carbreak = keyDown(UP)
carsteerleft = keyDown(LEFT)
carsteerright = keyDown(RIGHT)
carspeedtobreak = exist(1.jpg,2.jpg,3.jpg.... 10.jpg)   # these are 60 61 62 and higher mph images
carspeedtoaccelerate = exist(a.jpg, b.jpg.... ) # these are 0 to 10mph images

redlight = "red"
yellowlight = "yellow.jpg"

while caraccelerate   // always hold down up arrow key to accelerate
  if exist(carspeedtobreak,0)     // if car is over 60mps
    keyUp()    // release all keys    
    if exist(carspeedtoaccelerate,0)
      caraccelerate
    else
      carbreak

is this right?  am i going the right direction?  I don't want to continue if this doesn't work. 

Thanks everyone and RaiMan first!
 if exist(yellowlight,0)



-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.