Here you are:
mediafire.com/file/74rcbjcsv1b9d9a/planetattraction.cap
For tasks like this, sin and cos are your friends. The principle is as follows:
1) Calculate the distance from the objects to the planet on creation (posRadius)
2) Calculate the angle between the objects and the planet on creation (posAngle)
3) On every tick
- rotate planet by 'rotationspeed'
- rotate 'posAngle' by 'rotationspeed'
- set object's x to planet.X + cos('posAngle') * 'posRadius'
- set object's y to planet.Y + sin('posAngle') * 'posRadius'
- reduce 'posRadius'
You can reduce 'posRadius' with a fixed value. I reduce it based on the object's size (smaller ones get attracted faster than bigger ones). If you don't want that behavior, just set object's 'factor' to 1 in event 2:
replace
-> attracted: Set 'factor' to .Width / 32 - 0.5
with
-> attracted: Set 'factor' to 1
Set the strength of the planet's attraction with the pv 'force'.