"How did they..." "get here first?": first playable upload
As I said I just uploaded my first playable. All it is is my little stickman sliding about a rather simple and short level, but I felt like putting something up, since it works except that jumping up into blocks slides you right, no matter what... could use some ideas here.It has come to my attention that this does not work on a mac, it reads one of the data values as -1, instead of whatever it should be. I also noticed that I forgot some os.path calls, so windows users will need to change those.
I'll start work on sprites in the meantime.
(log in to comment)
Comments
The scrolling looks really nice with your background behind :)
Did you beat the collision boss? ;)
top = self.level.get_at(newpos.centerx, newpos.top)
if top and top.solid == "true":
newpos.top = top.rect.bottom
bottom = self.level.get_at(newpos.centerx, newpos.bottom)
if bottom and bottom.solid == "true":
newpos.bottom = bottom.rect.top
right1 = self.level.get_at(newpos.right, newpos.centery-(self.rect.height/4))
if right1 and right1.solid == "true":
newpos.right = right1.rect.left
right2 = self.level.get_at(newpos.right, newpos.centery+(self.rect.height/4))
if right2 and right2.solid == "true":
newpos.right = right2.rect.left
left1 = self.level.get_at(newpos.left, newpos.centery-(self.rect.height/4))
if left1 and left1.solid == "true":
newpos.left = left1.rect.right
left2 = self.level.get_at(newpos.left, newpos.centery+(self.rect.height/4))
if left2 and left2.solid == "true":
newpos.left = left2.rect.right
Good luck!
bitcraft on 2011/09/13 20:25:
not able to run on my mac:Traceback (most recent call last):
File "run_game.py", line 22, in <module>
main()
File "run_game.py", line 16, in main
game = src.Game(screen)
File "/Users/leif/Downloads/proj/src/game.py", line 11, in __init__
self.level = level.Level("res/lev/test.level")
File "/Users/leif/Downloads/proj/src/level.py", line 19, in __init__
self.tempdata = [[entity.Block(dict(self.conf.items(str(x)))) for x in y] for y in self.array]
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 634, in items
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: '-1'