I have a platformer game I am working on and want to add controls to a running animation for the player character so that it can collide with the ground and other objects.
sync on
`sync rate 40
xPos as integer
yPos as integer
xPos = 100
yPos = 100
load animation \"finalAni.gif\", 1
play animation 1, xPos, yPos
repeat
cls
if rightkey() = 1
inc xPos, 1
play animation 1, xPos, yPos
`place animation 1, 110, 110,
endif
if leftkey() = 1
dec xPos, 1
play animation 1, xPos, yPos
endif
sync
until escapekey()
That is what I have so far with some controls for movement. The problems I have is that when I move the animation, it stops while it moves and resumes after. I am also not sure how to add collision with other static sprites. Any help here would be greatly appreciated.