Answer the question
In order to leave comments, you need to log in
Creating a rectangular grid in cocos2d (python), what's the best way?
I am getting acquainted with the cocos2d library in python.
You need to create a rectangular area divided into squares (and then react differently to clicking different squares, for example, display a certain sprite on the pressed square).
Now a separate layer (ColorLayer) has been created for the rectangular area in the following way:
class MainSceneField(ColorLayer):
is_event_handler = True
def __init__(self):
super(MainSceneField, self).__init__(*GREEN, *FIELD_SIZE)
self.x = FIELD_OFFSET
self.y = FIELD_OFFSET
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question