-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdumbAI.py
More file actions
26 lines (22 loc) · 752 Bytes
/
dumbAI.py
File metadata and controls
26 lines (22 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# PACKET LAYOUT
# [Team, Str, fireRange, moveSpeed, x, y, heading, distance, direction]
# 0 1 2 3 4 5 6 7 8
from AI import AI
class dumbAI(AI):
def __init__(self):
pass
def get_move(self, packet, _unused):
i = 1
#Find next army on a different team
while packet[i][0] == packet[0][0]:
i += 1
nextOpponent = packet[i]
direction = packet[i][8]
distance = nextOpponent[7]-10 #10 unit buffer
for i in range(11):
newDist = (i/10) * packet[0][3]
if newDist > distance:
if i > 0:
i -= 1
break
return [i, direction]