Explorar o código

Fix floor tile rendering, issue #90

Maxime Chevalier-Boisvert %!s(int64=5) %!d(string=hai) anos
pai
achega
15da67b9ee
Modificáronse 1 ficheiros con 4 adicións e 10 borrados
  1. 4 10
      gym_minigrid/minigrid.py

+ 4 - 10
gym_minigrid/minigrid.py

@@ -171,17 +171,11 @@ class Floor(WorldObj):
     def can_overlap(self):
         return True
 
-    def render(self, r):
+    def render(self, img):
         # Give the floor a pale color
-        c = COLORS[self.color]
-        r.setLineColor(100, 100, 100, 0)
-        r.setColor(*c/2)
-        r.drawPolygon([
-            (1          , TILE_PIXELS),
-            (TILE_PIXELS, TILE_PIXELS),
-            (TILE_PIXELS,           1),
-            (1          ,           1)
-        ])
+        color = COLORS[self.color] / 2        
+        fill_coords(img, point_in_rect(0.031, 1, 0.031, 1), color)
+
 
 class Lava(WorldObj):
     def __init__(self):