all my sprites are moving together (except the background) and i cant find out why
im thinking its to do with the way the player sprite is created
//show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "LIL MERKS" )
SetWindowSize( 1000*0.5, 1000*0.5, 0 )
SetVirtualResolution( 1020,740 )
#include "Playmove.agc"
#include "Resources.agc"
wood=0
background=LoadSprite('map.png')
tall=LoadImage("tile129.png")
fallen=loadimage("tile129.png")
CreateText(1,"Wood: "+str(wood))
SetTextSize(1,60)
SetTextPosition(1,0,0)
//--------------------------------------------------------------
//create joystick
Joystick = 1
AddVirtualJoystick(Joystick, GetVirtualWidth()/6, GetVirtualHeight()-100,200)
joystick_bg=LoadImage('joystick_bg.png')
joystick_moveable=LoadImage('joystick_moveable.png')
SetVirtualJoystickImageInner(Joystick,joystick_moveable)
SetVirtualJoystickImageOuter(Joystick, joystick_bg )
//------------------------------------------------------------------
type player_class
id as integer
atlas as integer
fps as integer
state_now as string
state_last as string
speed as integer
endtype
global player as player_class
player.id=CreateSprite(0)
player.atlas = LoadImage("player.png")
player.fps = 6
player.speed = 5
SetSpritePositionByOffset(player.id, GetVirtualWidth()/2, GetVirtualHeight()/2-50)
SetSpriteDepth(player.id,0)
FixSpriteToScreen(player.id,1)
//--------------------------trees
for i=2 to 4
CreateSprite(i,tall)
SetSpritePosition(i,random(100,500),random(100,300))
FixSpriteToScreen(i,1)
setspritedepth(i,10)
next i
//--------------------------------------------------------------
//add animation
for i=1 to 20
AddSpriteAnimationFrame(player.id,LoadSubImage(player.atlas, str(i)))
next i