I Wanna Community

Fangames => Game Design => Topic started by: WetWookie on June 23, 2015, 07:44:46 PM

Title: WetWookie's Avoidance Scripts
Post by: WetWookie 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
(https://s18.postimg.org/gt4ir0gy1/Obj_Line.jpg)
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
(https://s2.postimg.org/h7nmrxza1/Obj_Circ.jpg)
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
(https://s14.postimg.org/jwyx7zq5t/Obj_Star.jpg)
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
(https://s2.postimg.org/gv5c26txl/Obj_Square.jpg)
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.
Title: Re: WetWookie's Avoidance Scripts
Post by: Sudnep on June 23, 2015, 08:49:56 PM
the god
Title: Re: WetWookie's Avoidance Scripts
Post by: WetWookie on June 24, 2015, 07:56:26 PM
added draw square and apply gravity
Title: Re: WetWookie's Avoidance Scripts
Post by: verveplay on June 28, 2015, 09:24:58 AM
That's amazing :0 Maybe will use later if i'll need it.