so I'm trying to make a game with pygame (Rogue-like type) and I have an issue... I cant make my character starts at the "start" square I can only make him start at 0,0 . My Level is generated with the help of a .txt file where w = wall 0 = path s = start and g = goal
So here is my code they are both in different classes (Level , Character). I tried to get the "start" coordinates with (start_rect = start.get_rect() ) but I wasnt able to use it on the other class , Maybe i just misused it ... So any help would be welcome
part of the Level code
wall = pygame.image.load(block).convert()
start = pygame.image.load(sstart).convert()
goal = pygame.image.load(sgoal).convert_alpha()
num_line = 0
for line in self.struct:
num_sqr = 0
for sprite in line :
x = num_sqr * size_sprite
y = num_line * size_sprite
if sprite == "w":
window.blit(wall, (x,y))
elif sprite == "s":
window.blit(start, (x,y))
elif sprite == "g":
window.blit(goal, (x,y))
part of the Character code :
self.sqrx = 0
self.sqry = 0
self.x = 0
self.y = 0
And sorry for any English mistakes its not my first language .