Basically I have two images of a character to make it look like it's walking. I simply want him to walk across the screen.
My code uses the Corona SDK and since some of you might not be familiar with that, I'll just simplify it:
When I run it, the character instantly moves to the ending position, only 1 frame change is noticeable, and all the "pauses" happen AFTER the loop is finished (when I debug, the loop starts, both the if statements are executed, and then it loops 74 more times without any if statements being executed. Then after looping is complete, it executes 2 pauses.)
I have no idea why this would happen and would appreciate any suggestions. Thanks!
My code uses the Corona SDK and since some of you might not be familiar with that, I'll just simplify it:
Code
for i = 0, 150, 2
if sprite = 1 then
move sprite over by current position + i
sprite = 2
pause for 500 miliseconds()
end
if sprite = 2 then
move sprite over by current position + i
sprite = 1
pause for 500 miliseconds()
end
endWhen I run it, the character instantly moves to the ending position, only 1 frame change is noticeable, and all the "pauses" happen AFTER the loop is finished (when I debug, the loop starts, both the if statements are executed, and then it loops 74 more times without any if statements being executed. Then after looping is complete, it executes 2 pauses.)
I have no idea why this would happen and would appreciate any suggestions. Thanks!
