Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[GM7] Arm stretching Help.


BOB_ROX

Recommended Posts

I made a object called obj_launch and another object called obj_Hand now what there supposed to do is that when you mouse click onto a grabber object so you can stretch your arm and pull yourself up it does that, My problem is that it DOES work except that when I click somewhere else it stretches and keeps going AND it wont go back to obj_sonic when released, Now before you suggest anything I'd just like to say I went to global left released and it came up with the error unknown varible x but when i removed that button released it worked without the error coming up, ill make a second post for the object codes and where they go on the objects. And if possible, Can someone tell me the right place to add the sound code into too please?

Thanks in advance!!

Link to comment
Share on other sites

obj_sonic:

Global left button:

change to obj_launch

obj_launch:

Collision with obj_Grabber:

with(obj_Hand){
f=0;
instance_destroy();
}
x=xprevious;
y=yprevious;[/CODE]

[CODE]if place_free(x+96,y-20){sprite_index = spr_ledgegrab}[/CODE]

Global left button:

[CODE]with(obj_Hand){
instance_destroy();
}
g=instance_create(x,y,obj_Hand);
g.direction=point_direction(x,y,mouse_x,mouse_y);
g.f=1[/CODE]

obj_Hand:

Step event:

[CODE]if f=1{
x+=lengthdir_x(8,direction);
y+=lengthdir_y(8,direction);
}
else
{
obj_launch.x+=lengthdir_x(4,direction);
obj_launch.y+=lengthdir_y(4,direction);
}[/CODE]

Collision with obj_Grabber:

[CODE]f=0[/CODE]

Draw:

[CODE]draw_line(obj_launch.x,obj_launch.y,x,y)
draw_sprite(sprite30,0,x,y);[/CODE]

Link to comment
Share on other sites

Actually never mind problem is solved my only problem I got is to change the line which connects to the hand to the body to be thicker and a different color and the release button error also. Can anyone help me with that?

Sorry for triple post by the way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...