Wireframe-Magazine / Wireframe-34

Projects and assets from Wireframe #34
Other
11 stars 7 forks source link

NameError: name 'Actor' is not defined #1

Open bakerbrown opened 4 years ago

bakerbrown commented 4 years ago

After using pip install pgzero I get an error when trying to run 'NameError: name 'Actor' is not defined'

I am using Python 3.7.5 Pygame 1.9.6 was also installed

orsenthil commented 4 years ago

I had to make the following changes.

 # Marble Madness
 from pygame import image

+import pgzrun
+
+from pgzrun import *
+
+from pgzero.builtins import Actor, animate, keyboard
+
+
 HEIGHT = 570
 WIDTH = 600
 gameState = 0
@@ -36,7 +43,7 @@ def update():
             marble.speed = min(1,marble.speed + 0.1)
         moveMarble()
         marble.speed = max(0,marble.speed - 0.01)
-    
+
 def moveMarble():
     global gameState
     ccol = getHeight(marbleh.x,marbleh.y)
@@ -60,3 +67,4 @@ def getHeight(x,y):
     return heightmap.get_at((int(x),int(y)))

+pgzrun.go()
christo commented 4 years ago

@orsenthil did you try my PR?