Advertisement
Guest User

Fangames: Make Apple Star Code

a guest
Nov 27th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. //script = make_star(x,y,outer radius,inner radius,lines amount,apples per line,offset,speed,burst);
  2. //argument0 = center x, or where the star is built around.
  3. //argument1 = center y, or where the star is built around.
  4. //argument2 = how far outward the star goes in pixels.
  5. //argument3 = how far outward the star's caves go, in pixels.
  6. //argument4 = how many points the star has.
  7. //argument5 = how many apples are put in between each line.
  8. //argument6 = the offset angle of the star.
  9. //argument7 = the speed multiplier of the apples.
  10. //argument8 = whether the apples start in their normal positions or exactly at the center positions.
  11.  
  12. for(i=0;i<argument4;i+=1){
  13. angle=(360/argument4*i)+argument6;
  14. angle2=(360/argument4*(i+0.5))+argument6;
  15. p1x=argument0+(argument2*sin(degtorad(angle)));
  16. p1y=argument1+(argument2*cos(degtorad(angle)));
  17. p2x=argument0+(argument3*sin(degtorad(angle2)));
  18. p2y=argument1+(argument3*cos(degtorad(angle2)));
  19. for(amt=0;amt<=argument5;amt+=1){
  20. vertical=(p2x-p1x);
  21. if vertical!=0{
  22. slope=(p2y-p1y)/(p2x-p1x);
  23. slopex=(p2x-p1x)*(1/argument5*amt);
  24. slopey=slopex*slope;
  25. }
  26. else{
  27. slopex=0;
  28. slopey=(p2y-p1y)/argument5*amt;
  29. }
  30. a=instance_create(p1x+slopex,p1y+slopey,deliciousFruit);
  31. a.direction=point_direction(argument0,argument1,a.x,a.y);
  32. a.speed=point_distance(argument0,argument1,a.x,a.y)/point_distance(p1x,p1y,argument0,argument1)*argument7;
  33. if argument8=1{
  34. a.x=argument0;
  35. a.y=argument1;
  36. }
  37. }
  38. angle2=(360/argument4*(i-0.5))+argument6;
  39. p2x=argument0+(argument3*sin(degtorad(angle2)));
  40. p2y=argument1+(argument3*cos(degtorad(angle2)));
  41. for(amt=0;amt<argument5;amt+=1){
  42. if amt!=0 && amt!=argument5{
  43. vertical=(p2x-p1x);
  44. if vertical!=0{
  45. slope=(p2y-p1y)/(p2x-p1x);
  46. slopex=(p2x-p1x)*(1/argument5*amt);
  47. slopey=slopex*slope;
  48. }
  49. else{
  50. slopex=0;
  51. slopey=(p2y-p1y)/argument5*amt;
  52. }
  53. a=instance_create(p1x+slopex,p1y+slopey,deliciousFruit);
  54. a.direction=point_direction(argument0,argument1,a.x,a.y);
  55. a.speed=point_distance(argument0,argument1,a.x,a.y)/point_distance(p1x,p1y,argument0,argument1)*argument7;
  56. if argument8=1{
  57. a.x=argument0;
  58. a.y=argument1;
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement