-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added minimap file #272
base: develop
Are you sure you want to change the base?
Added minimap file #272
Conversation
sc2/minimap.py
Outdated
return map_data | ||
|
||
@property_cache_forever | ||
def heighmap(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: heightmap
sc2/minimap.py
Outdated
def add_minerals(self, map_data): | ||
for mineral in self.game.state.resources: | ||
mine_pos = mineral.position | ||
cv2.circle(map_data, (int(mine_pos[0]*self.map_scale), int(mine_pos[1]*self.map_scale)), int(mineral.radius*self.map_scale), (255, 255, 86), -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minerals are 1.5*0.5 rectangles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can I know orientation?
sc2/minimap.py
Outdated
return map_data | ||
|
||
def add_minerals(self, map_data): | ||
for mineral in self.game.state.resources: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use mineral_field
, because resources
also contains the geysers
sc2/minimap.py
Outdated
map_data, | ||
( | ||
int((unit.position[0] - unit.radius / 2) * self.map_scale), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont need to devide the radius by 2
sc2/minimap.py
Outdated
# cv2.circle(map_data, (int(unit.position[0]*self.map_scale), int(unit.position[1]*self.map_scale)), int(unit.radius*self.map_scale), (0, 250, 250), -1) | ||
|
||
for unit in self.game.known_enemy_units: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt this a duplicate of add_enemies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is
sc2/minimap.py
Outdated
-1, | ||
) | ||
if self.show_ramps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything in here are just map tiles, no real objects, so they should be squares not circles
sc2/minimap.py
Outdated
show_allies=True, | ||
show_enemies=True | ||
): | ||
self.game = game |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add all colors to init to be able to change them easier and add a comment what color it is
No description provided.