i dont know why the code thing is squished. probably a bug with the new forumsPut this in the cherry step event
Cherry Step Event:
if spin = true {
scrSpin(orbitObject,orbitAngle,orbitSpeed,orbitRadius,orbitDirection,orbitX,orbitY) // spin object [if direction = 1 { clockwise } else { counterclockwise }]
if orbitRadiusMax > orbitRadius { orbitRadiusDec = true } // if radiusMax is greater than the current radius, decrease it
if orbitRadiusDec = true { orbitRadius += orbitRadiusDev; if orbitRadius > orbitRadiusMax { orbitRadius = orbitRadiusMax; orbitRadiusDec = false } } // decrease radius
if orbitRadiusMax < orbitRadius { orbitRadiusInc = true } // if radiusMax is less than the current radius, increase it
if orbitRadiusInc = true { orbitRadius -= orbitRadiusDev; if orbitRadius < orbitRadiusMax { orbitRadius = orbitRadiusMax; orbitRadiusInc = false } } // increase radius
}
Scripts to make it run.
(Only use this one, spin code is just ran in the cherry step)
Make it Spin Code:
//scrMakeCherrySpin(object,x,y,speed,direction,radiusMax,radiusDev)
var object,xx,yy,angle,fast,radius,dir,radiusMax,radiusDev;
object = argument0
xx = argument1
yy = argument2
fast = argument3
dir = argument4
radiusMax = argument5
radiusDev = argument6
if object != 1 { angle = point_direction(object.x,object.y,x,y) } else { angle = point_direction(xx,yy,x,y) }
if object != 1 { radius = distance_to_point(object.x,object.y) } else { radius = distance_to_point(xx,yy) }
if object = 1 { object = 9999 }
spin = true
orbitObject = object
orbitX = xx
orbitY = yy
orbitAngle = angle
orbitSpeed = fast
orbitRadius = radius
orbitDirection = dir
orbitRadiusMax = radiusMax
orbitRadiusDev = radiusDevdiusDev
Spin Code:
//scrSpin(Orbited Object,Current Angle,Speed,Radius,Direction,rx,ry)
orbitObject = argument0
orbitAngle = argument1
orbitSpeed = argument2
orbitRadius = argument3
orbitReverse = argument4
orbitX = argument5
orbitY = argument6
if (orbitDirection) {
if orbitObject != 9999 {
orbitAngle += orbitSpeed;
x = orbitObject.x + orbitRadius * cos(orbitAngle * pi / 180);
y = orbitObject.y - orbitRadius * sin(orbitAngle * pi / 180);
} else {
orbitAngle += orbitSpeed;
x = orbitX + orbitRadius * cos(orbitAngle * pi / 180);
y = orbitY - orbitRadius * sin(orbitAngle * pi / 180);
}
} else {
if orbitObject != 9999 {
orbitAngle -= orbitSpeed;
x = orbitObject.x + orbitRadius * cos(orbitAngle * pi / 180);
y = orbitObject.y - orbitRadius * sin(orbitAngle * pi / 180);
} else {
orbitAngle -= orbitSpeed;
x = orbitX + orbitRadius * cos(orbitAngle * pi / 180);
y = orbitY - orbitRadius * sin(orbitAngle * pi / 180);
}
}
How to run it:
Run this script with variables associated like thie
with(delicious_fruit) { scrMakeCherrySpin(object,x,y,speed,direction,radiusMax,radiusDev) }
object = object name ( if no object set it to 1 )
x = if no object, set this to x pos you want it to rotate around
y = if no object, set this to y pos you want it to rotate around
speed = how fast it rotates around object / x,y cord
direction = 1 for clockwise; 0 for counterclockwise (i forgot which one it is)
radiusMax = maximum radius it is allowed to expand to (for cases where you want the circle thing to expand out a certain amount)
radiusDev = the speed at which it expands
This is what I use to make shit spin. There are probably easier ways but this is how I do it.