I'm trying to make my own point item from scratch, I can draw the sprite, but I can't get the object to move at all or set it's position.
task MagicPoints(x,y){
// Randomly chooses one of the four sprites form the sprite sheet.
let ex = rand2(128,128+32);
let ey = rand2(0,32);
let path = GetCurrentScriptDirectory() ~ "img/sprite/items.png";
let obj = ObjPrim_Create(OBJ_SPRITE_2D);
ObjPrim_SetTexture(obj, path);
ObjMove_SetPosition(obj,x,y); // Doesn't work
Obj_SetRenderPriority(obj, 100);
ObjSprite2D_SetSourceRect(obj, ex, ey, ex+32, ey+32);
ObjSprite2D_SetDestRect(obj, ObjMove_GetX(obj), ObjMove_GetY(obj), ObjMove_GetX(obj)+32, ObjMove_GetY(obj)+32);
ObjMove_SetSpeed(obj,2); // Doesn't work
ObjMove_SetAngle(obj,90); // Doesn't work
loop{
// When the player gets close to the item it's deleted and the item count is updated.
if(ObjecttoPlayer(obj) <= 4){
//PlaySound(shot1);
Scores += 1;
Obj_Delete(obj);
}
yield;
}
}