How do I detect if sprite should be going up or down?
- by Geore Shg
I use the following code to detect if a sprite should be going up or down:
If (pos.Y + 100) >= Sprite.BottomY Then
Going_up = True
pos.Y = Sprite.BottomY - 130
End If
If pos.Y <= Sprite.TopY Then
Going_up = False
pos.Y = Sprite.TopY - 1
Vel.Y = 3
End If
Then my response code:
If Going_up Then
Vel.Y -=…