Change spState when direction change in spRandom
问题 another swimming fish question ;-) Is there a way to detect the direction in which spRandom is currently moving ? So that I can change the spState of my sprite from 1 to 2. if direction=left spState(1) -> Fish faces left if direction=right spState(2) -> Fish faces right Hope you understand my question. I did not post any example code yet. Hope anyone can give me a generic example of how to do that. Thanks and greetz, Arno. 回答1: You can always get the position of the element: $('#bird')