Hoping someone can help me out here; trying to complete “Stranded in the Dunes” in Python and, whilst I don’t believe it’s a bug per se, I’m really not sure how to complete it without using flags.
The problem being that when I use self.pos.x+1 to move the character right, that’s all well and fine up until it hits the right border and the scene changes, but that currentPos = self.pos isn’t updating, because the last x point is held over from the previous screen.
This can be demonstrated in a particularly horrible and simple loop I used to narrow down the issue here:
loop: enemy = self.findNearestEnemy() if enemy: self.attack(enemy) else: currentPos = self.pos self.say(currentPos) self.moveXY(currentPos.x + 1, currentPos.y)
Without knowing how (or being able?) to edge detect, I’m not really sure how to do this level without using flags, which I was hoping to do.