Ejemplo n.º 1
0
def commands():
    """ loop of bot's commands"""
        
    """to lock the radar with the gun"""
    gamefile.lockradar("GUN")
        
    """to lock the unlock radar"""
    gamefile.lockradar("FREE")
       
    """To fire"""  
    gamefile.fire(2)

    """To know the number of alive bot"""
    gamefile.nbr_bots_left()

    """To turn left in degrees"""
    gamefile.turn_left(180)
    
    """To go forward 180 steps"""
    gamefile.move(180)
    
    """To turn Right in degrees"""
    gamefile.turn_right(180)
    
    """To go forward 180 steps"""
    gamefile.move(180)
    
    """NECESSARY for the end of the loop"""
    gamefile.done()
Ejemplo n.º 2
0
def target_spotted(direction, targetBotName, targetX, targetY):
    """when a bot is seen"""
    
    """Point the gun into the target"""
    gamefile.pointgun(direction)
    
    """To fire""" 
    gamefile.fire(2)
def commands():
        gamefile.move(200)
	gamefile.turn_right(90)
	gamefile.stop(100)
	gamefile.move(22)
	gamefile.turn_right(90)
	gamefile.fire()
	gamefile.done()
Ejemplo n.º 4
0
def commands():
        gamefile.move(200)
	gamefile.turn_right(90)
	gamefile.stop(100)
	gamefile.move(22)
	gamefile.turn_right(90)
	gamefile.fire(2)
	gamefile.done()
Ejemplo n.º 5
0
def commands():
    gamefile.move(200)
    gamefile.turn_left(90)
    gamefile.fire(2)
    gamefile.turn_left(90)
    gamefile.fire(2)
    gamefile.turn_left(90)
    gamefile.fire(2)
    gamefile.turn_left(90)
    gamefile.fire(2)
    gamefile.done()
Ejemplo n.º 6
0
def commands():
    gamefile.move(100)
    gamefile.lockradar("FREE")
    gamefile.spinradar("LEFT")
    if (healthVal > 40):
        gamefile.turn_left(45)
    gamefile.spinradar("RIGHT")
    if (healthVal > 40):
        gamefile.stop(60)
    gamefile.fire()
    gamefile.move(100)
    if (healthVal > 40):
        gamefile.turn_right(45)
    if (healthVal < 40):
        if (lastTarget > 0):
            gamefile.turn_right(45)
        if (lastTarget < 0):
            gamefile.turn_left(45)

    global healthVal
    healthVal = gamefile.robotHealth()
    gamefile.done()
Ejemplo n.º 7
0
def commands():
        gamefile.move(100)
        gamefile.lockradar("FREE")
        gamefile.spinradar("LEFT")
        if (healthVal > 40):
                gamefile.turn_left(45)
        gamefile.spinradar("RIGHT")
        if (healthVal > 40):
                gamefile.stop(60)
	gamefile.fire(2)
	gamefile.move(100)
	if (healthVal > 40):
                gamefile.turn_right(45)
        if (healthVal < 40):
                if (lastTarget > 0):
                        gamefile.turn_right(45)
                if (lastTarget < 0):
                        gamefile.turn_left(45)
                
	
	global healthVal
	healthVal = gamefile.robotHealth()
	gamefile.done()
Ejemplo n.º 8
0
def target_spotted(direction):
    gamefile.pointgun(direction * 1.1)
    global lastTarget
    lastTarget = direction
    gamefile.fire()
Ejemplo n.º 9
0
def commands():
        gamefile.move(180)
	gamefile.fire(2)
        gamefile.stop(180)
        gamefile.fire(2)
	gamefile.turn_left(120)
        gamefile.fire(2)
	gamefile.turn_right(120)
        gamefile.fire(2)
	gamefile.turn_right(120)
        gamefile.fire(2)
	gamefile.turn_left(120)
        gamefile.fire(2)
	gamefile.done()
Ejemplo n.º 10
0
def target_spotted(direction, targetBotName, targetX, targetY):
        gamefile.pointgun(direction*1.4)
        gamefile.fire(2)
        gamefile.fire(2)
	gamefile.fire(2)
Ejemplo n.º 11
0
def target_spotted(direction):
        gamefile.pointgun((direction)*1.3)
        gamefile.fire()
Ejemplo n.º 12
0
def target_spotted(direction, targetBotName, targetX, targetY):
        gamefile.pointgun(direction*1.1)
        global lastTarget
        lastTarget = direction
        gamefile.fire(2)
Ejemplo n.º 13
0
def target_spotted(direction):
        gamefile.pointgun(direction*1.4)
        gamefile.fire()
        gamefile.fire()
	gamefile.fire()
Ejemplo n.º 14
0
def target_spotted(direction, targetBotName, targetX, targetY):
    gamefile.pointgun(direction * 1.1)
    global lastTarget
    lastTarget = direction
    gamefile.fire(2)