Hi,
I have a very simple app that has a rectangle on bottom and it shoots projectiles upwards.
when the projectile reaches its desired destination that projectile should get removed with onCompleted option..
I have this component as the projectile :
Component {
id: projectile
EntityBase {
id:projectileEntity
entityId: "projectile"
entityType: "projectile"
//x: 100
Image {
id:projectileSprite
source: "img/asteroid.png"
width: 4
height: 4
}
CircleCollider {
radius: projectileSprite.width/2
anchors.centerIn: parent
bodyType: Body.Static
}
// these values can then be set when a new projectile is created in the MouseArea below
property alias to: moveTo.to
property alias duration: moveTo.duration
PropertyAnimation on pos {
id: moveTo
from: ship.pos
alwaysRunToEnd: true
// the "to" and "duration" property will be set for each entity differently
onCompleted: {
console.debug("Completed ");
removeEntity()
}
}
}
}
The problem I’m running into is that only odd numbered (1,3,5 ect..) projectiles get removed and the others are left on the scene hanging..
What am I doing wrong here.
Thanks