Before reading the code, It's a modified Hello's Wiggler object.
I might hear I should make my own.
Stun code
Slope logic
When spawned
If you need more, let me know.
Anyone here?
I might hear I should make my own.
Stun code
Code:
//Stop body parts
for (i=0; i<maxpart; i++) {
//Affect parts animation
with (part[i]) {
//Freeze
image_speed = 0;
hspeed = 0;
//Stop turn sequence
timerstart = 0;
//Snap the parts
x = behind.x-offset*xscale;
//Turn him into a "accordion"!
offset = 3;
}
Slope logic
Code:
//Embed into the slope to ensure correct slope mechanics
if (collision_rectangle(bbox_left,bbox_bottom,bbox_right,bbox_bottom+4,obj_slopeparent,1,0))
and (!collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom-4,obj_slopeparent,1,0))
and (vspeed = 0)
y += 4;
///Handle slope collisions
if (collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0))
&& (!collision_rectangle(bbox_left,bbox_bottom-8,bbox_right,bbox_bottom-8,obj_slopeparent,1,0)) {
//Stay embed on the slope.
while collision_rectangle(bbox_left,bbox_bottom-4,bbox_right,bbox_bottom,obj_slopeparent,1,0)
y--;
}
When spawned
Code:
//Create anatomy
part[0] = instance_create(x,y,obj_wiggler_body) {
part[0].image_index = 0;
part[0].depth = -1
part[0].parent = id;
part[0].behind = other.id; //Snaps to the head
}
part[1] = instance_create(x,y,obj_wiggler_body) {
part[1].image_index = 1;
part[1].depth = 0
part[1].behind = part[0];//Snaps to the previous body and so on.
part[1].parent = id;
}
part[2] = instance_create(x,y,obj_wiggler_body) {
part[2].image_index = 2;
part[2].depth = 1
part[2].behind = part[1];
part[2].parent = id;
}
part[3] = instance_create(x,y,obj_wiggler_body) {
part[3].image_index = 3;
part[3].depth = 2
part[3].behind = part[2];
part[3].parent = id;
}
If you need more, let me know.
Anyone here?
A new signature is on the works but have this:
![[Image: lol.gif]](https://s18.postimg.cc/lf5mae42h/lol.gif)