Animation InitializeTranslate help

thestar19

Member
Licensed User
Longtime User
Hey

So,I am developing a simple game where a spaceship will move to the position where the user touched.

This is my code sofar:

B4X:
Sub move_player_Touch (Action As Int, X As Float, Y As Float)
Dim prev_X As Int
Dim prev_Y As Int
prev_X = 130
prev_Y = 370
Dim a1 As Animation
a1.InitializeTranslate("player_image",prev_X,prev_Y,X,Y)
a1.Duration = 1000
a1.Start(player_image)
prev_X = X
prev_Y = Y
End Sub

Howewer,Right now it moves but totally wrong. So If I press in the middle if moves like from left to right in a totally wrong place.
The prev_X and prev_Y variable represents where the image of the spaceship starts in the beginning of the game.

What am I doing wrong?

Thank you
Thestar19

Edit:

Ive worked alot more with it but I cant seem to get it work so if anybody has any idea,please!
 
Last edited:
Top