142
« on: January 20, 2016, 04:56:11 PM »
I can only help with the first one, and hopefully it's what you're looking for.
argument0=centerX;
argument1=centerY;
argument2=radius;
argument3=position; //the position of where the cherry will spawn (in degrees)
argument4=radiusSpeed; //the speed of the cherry's movement - moves away from its centerX and centerY
argument5=spinSpeed; //the speed of the cherry's revolution
x=centerX+lengthdir_x(radius+rad,position+pos);
y=centerY+lengthdir_y(radius+rad,position+pos);
rad+=radiusSpeed;
pos+=spinSpeed;
//Note that I used position instead of direction here, as I've had problems with the cherries jumping forward a certain angle when they spawn another object with an incremented direction
and to spawn them, set an alarm and do the following:
for(i=0;i<360;i+=360/num1){ //this is only for if you want more than one cherry spawned at the same time, and set num1 to however many cherries you want spawned at a time
a=instance_create(room_width/2,room_height/2,objCherry); //using the center of the room as an example
a.centerX=a.xstart;
a.centerY=a.ystart;
a.radius=0;
a.position=i; //replace i with whatever direction you want if you only want one cherry spawned at a time
a.radiusSpeed=num2; //set num2 to how fast you want the cherry to move away from it's centerX and centerY
a.spinSpeed=num3; //set num3 to how fast you want the cherry to revolve
}
alarm[0]=num4; //set num4 to how frequently you want the cherries to spawn
If you want the direction (or, with the way I made it, the position) of the cherries to change whenever a new one is spawned, add this:
~
a.position=i+dir;
~
dir+=num5; //set num5 to how much you want the cherries' direction (position) to change
and that's it, hopefully this can be of use for you :3
EDIT: tfw watson replied before me