Auer
Apr 11, 2018 - 00:57
This full code has a small section that throws no errors but for some reason doesn't work.
n0de.position=touch.location
^Works just fine... but the following
if n0de.position.x>touch.location.x:
n0de.position.x-=self.speed
elif n0de.position.x <touch.location.x:
n0de.position.x+=self.speed
if n0de.position.y >touch.location.y:
n0de.position.y-=self.speed
elif n0de.position.y<touch.location.y:
n0de.position.y+=self.speed
Doesn't do anything. Tho when I replace the position changing lines with print statements it works fine.
eg
if n0de.position.y >touch.location.y:
print('moves down')
I assume I'm missing something about updating Sprite positions?
Thanks.