示例#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()
示例#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()
示例#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()
示例#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()
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()
示例#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()
def target_spotted(direction):
    gamefile.pointgun(direction * 1.1)
    global lastTarget
    lastTarget = direction
    gamefile.fire()
示例#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()
示例#10
0
def target_spotted(direction, targetBotName, targetX, targetY):
        gamefile.pointgun(direction*1.4)
        gamefile.fire(2)
        gamefile.fire(2)
	gamefile.fire(2)
def target_spotted(direction):
        gamefile.pointgun((direction)*1.3)
        gamefile.fire()
示例#12
0
def target_spotted(direction, targetBotName, targetX, targetY):
        gamefile.pointgun(direction*1.1)
        global lastTarget
        lastTarget = direction
        gamefile.fire(2)
示例#13
0
def target_spotted(direction):
        gamefile.pointgun(direction*1.4)
        gamefile.fire()
        gamefile.fire()
	gamefile.fire()
示例#14
0
def target_spotted(direction, targetBotName, targetX, targetY):
    gamefile.pointgun(direction * 1.1)
    global lastTarget
    lastTarget = direction
    gamefile.fire(2)