Re: Pyglet tile scrolling

138 views
Skip to first unread message

Richard Jones

unread,
Aug 5, 2012, 11:51:30 PM8/5/12
to pyglet...@googlegroups.com
On 5 August 2012 11:12, Wallace Davidson <walla...@gmail.com> wrote:
> couldn't find any tutorials. I also had a look at cocos2d and it seems to be
> exactly what I want but again I wasn't sure where to start with tile
> scrolling. Any help or examples would be a huge help :)

The docs for the cocos2d tile mapping stuff are thin, but the API is
well-documented and the two test files (test/test_tiles.py and
test/test_tmx.py) give a pretty good code starting point.


Richard

Wallace Davidson

unread,
Aug 6, 2012, 2:08:51 AM8/6/12
to pyglet...@googlegroups.com
Thanks I didn't realise there were some examples. I think I will go with cocos2d

On Sunday, August 5, 2012 1:12:09 PM UTC+12, Wallace Davidson wrote:
I am trying to make a top down tile based rpg (with randomly generated terrain) and I have managed to draw the tiles on the screen in a batch and move them when the player presses a key. I am pretty new to pyglet so this is probably the worst way to do it.

if keys[key.W]:
      for a in tiles_1:
          a.y -=5

Right now I am trying to do it like that ^ 

However when I have a map larger than about 700 tiles it fails to run quicker than 3 fps. I have been looking around and seen lots of stuff about off screen culling and textures but I haven't any idea how to do this as I couldn't find any tutorials. I also had a look at cocos2d and it seems to be exactly what I want but again I wasn't sure where to start with tile scrolling. Any help or examples would be a huge help :)

Thanks
Reply all
Reply to author
Forward
0 new messages