On Wed, Aug 7, 2013 at 5:55 PM, Art Aquino <[email protected]> wrote:
> Hello. I am having a problem walking on top of RectCells that have the
> collision booleans set on all sides. The player moves across the tile but
> then stops when colliding with the next tile, even though they are both
> next to each other. I can avoid this problem by only setting the "top"
> property and then the player can walk normally.
>
> My question is, can these properties be set at runtime?
>
Yes
> I noticed that the collisions occur even if the boolean properties are set
> to "no". So it appears that having the property, regardless of its value
> causes a collision.
>
>
Try with the value False .
A alternative way is to delete the boundary, like
del cell[i][j].properties['top']
I need to be able to change the sides that can collide during runtime. How
> is this possible? I looked at the get() method and I can change the
> properties that way, but if I set the property to "no" or "None:, the
> collision still occurs. So how do I add or remove tile properties?
>
>
These properties ('top', 'left', ...) are expected to be booleans, ie with
value True or False , with no quotes.
Look at cocos.tiles.RectMapCollider.do_collision if you want
> The project can viewed here: https://github.com/Art9681/2D_Terrain_Game
>
> I have disabled automatic terrain generation for testing. If you want to
> reenable it just uncomment line 19 in main.py
>
> Run main.py to launch it. The project requires the python noise library
> located here: https://pypi.python.org/pypi/noise/
>
>
And also requires pymunk. Which version are you using ? The one I have
complains:
(traceback)
...
import pymunk.pyglet_util
ImportError: No module named pyglet_util
> When you click on a tile, it gets changed to an "air" tile. I need to
> reconfigure colliders around the tiles that are next to air tiles at run
> time. Please help.
> --
>
>
>
--
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 http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.