Author Topic: WetWookie's Avoidance Scripts  (Read 2771 times)

WetWookie

  • Cherry Eater
  • Posts: 90
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
  • Playstyle: Keyboard
WetWookie's Avoidance Scripts
« on: June 23, 2015, 07:44:46 PM »
I did the thing so you don't have to

All of the draw scripts allow you to 'tag' the objects you create. You can then submit those tags to the manipulation scripts so they only affect the objects you tagged with the same value. For example you can draw a star of cherries with tag of 1 and a circle of cherries with a tag of 2 and then explode all cherries with a tag of 1 while leaving the cherries with a tag of 2 untouched. Also I recommend using objects with the sprite origin set to the center. If you don't things will look weird when you start changing your image_angle.

Drawing Shapes

draw_object_line(x1,y1,x2,y2,NumberOfObjectsInLine,ObjectOrientation,ObjectType,Tag);
Draws a line of objects

ex. draw_object_line(room_width/2-200, room_height/2, room_width/2+200, room_height/2, 10, 0, cherry,1);
(click to show/hide)

draw_object_circle(CenterX, Centery, Radius, AngleOffset, NumberOfObjects,ObjOrientation,ObjectType,tag);
Draws a circle of objects

ex. draw_object_circle(room_width/2, room_height/2,50,0,10,1,cherry,0);
(click to show/hide)

draw_object_star(CenterX,Centery,Radius,NumArms,ArmLength,AngleOffset,NumObjectsPerArm,ObjOrientation,ObjectType,tag);
Draws a star of objects

ex. draw_object_star(room_width/2, room_height/2,75,5,70,0,7,0,cherry,1);
(click to show/hide)

draw_object_square(CenterX, CenterY ,SideLength,ObjectsPerSide,AngleOffset,ObjectOrientation,ObjectType,tag);
Draws a square

draw_object_square(room_width/2-150, room_height/2 ,250,10,0,0,cherry,0);
draw_object_square(room_width/2+150, room_height/2 ,200,10,0,0,cherry,1);
draw_object_square(room_width/2+150, room_height/2 ,200,10,45,0,cherry,1);
(click to show/hide)


Object Manipulation

explode_objects(CenterX, CenterY, ObjectSpeed, ObjectOrientation,ObjectType,tag);
Causes all matching objects to move away from CenterX,CenterY
ex. explode_objects(room_width/2,room_height/2,4,1,cherry,1);
(click to show/hide)

implode_objects(CenterX,CenterY,ObjectSpeed,ObjectOrientation,ObjectType,tag);
Causes all matching objects to move towards CenterX,CenterY
ex. implode_objects(room_width/2,room_height/2,4,1,cherry,1);
(click to show/hide)

group_move_objects(TargetX, TargetY, ObjectSpeed, ObjectOrient, ObjectType, tag)
Moves entire group of objects as one unit toward the target without breaking their shape
ex. group_move_objects(player.x,player.y,4,1,cherry,1);
(click to show/hide)

apply_gravity(GravValue, ImageOrient, ObjectType,tag)
Gives matching objects gravity
apply_gravity(0.4,1,cherry,1);
(click to show/hide)


Feel free to point out errors, request shapes and manipulations and submit your own scripts.
« Last Edit: June 24, 2015, 07:55:53 PM by WetWookie »

Sudnep

  • Global Moderator
  • Spike Dodger
  • Posts: 124
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.130 Chrome 43.0.2357.130
    • View Profile
  • Playstyle: Keyboard
Re: WetWookie's Avoidance Scripts
« Reply #1 on: June 23, 2015, 08:49:56 PM »
the god

WetWookie

  • Cherry Eater
  • Posts: 90
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
  • Playstyle: Keyboard
Re: WetWookie's Avoidance Scripts
« Reply #2 on: June 24, 2015, 07:56:26 PM »
added draw square and apply gravity

verveplay

  • Wannabe
  • Posts: 31
  • Hi
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 38.0 Firefox 38.0
    • View Profile
  • Playstyle: Keyboard
Re: WetWookie's Avoidance Scripts
« Reply #3 on: June 28, 2015, 09:24:58 AM »
That's amazing :0 Maybe will use later if i'll need it.