Trying to run this code:

import cocos
class Ant(cocos.layer.Layer):
    def __init__(self):
        super(Ant, self).__init__()
        centerPoint=cocos.draw.Vector2(200,200)
        circle=cocos.draw.Circle(centerPoint, 30.0)
        self.add(circle)

cocos.director.director.init(width=640, height=480)
scene=cocos.scene.Scene(Ant())
cocos.director.director.run(scene)

I get these errors:

Traceback (most recent call last):
File "C:/Users/Rogerio/Desktop/Python/PyCharm/carro/teste2.py", line 11, in 
cocos.director.director.run(scene)
File "C:\Program Files\Python\lib\site-packages\cocos\director.py", line 
403, in run
self._set_scene(scene)
File "C:\Program Files\Python\lib\site-packages\cocos\director.py", line 
532, in _set_scene
scene.on_enter()
File "C:\Program Files\Python\lib\site-packages\cocos\scene.py", line 89, 
in on_enter
super(Scene, self).on_enter()
File "C:\Program Files\Python\lib\site-packages\cocos\cocosnode.py", line 
611, in on_enter
c.on_enter()
File "C:\Program 
Files\Python\lib\site-packages\cocos\layer\base_layers.py", line 73, in 
on_enter
super(Layer, self).on_enter()
File "C:\Program Files\Python\lib\site-packages\cocos\cocosnode.py", line 
611, in on_enter
c.on_enter()
AttributeError: 'Circle' object has no attribute 'on_enter'

How to solve this?

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to