xNYARLx
Member
Hello.
I try making Grappling hook.
First problems:
The point is that it is to be controlled from the keyboard: left, right, up, down arrows and "D" button to use hook. !NOT USE MOUSE!
I made obj_solid_s to grab it and it does it but only one on the board (I have 5 obj_solid_s on board) and in the same place (in the middle of obj_solid_s) and from anywhere on the board.
I no a PRO, somebady can help me?
Second problem:
!Interest me too how change this:
//Position of rope where we clicked
grappleX = mouse_x;
grappleY = mouse_y;
when i dont use mouse.!
Thanks for helping anyway...
I make something like this:
obj_player
CREATE
STEP
DRAW
I try making Grappling hook.
First problems:
The point is that it is to be controlled from the keyboard: left, right, up, down arrows and "D" button to use hook. !NOT USE MOUSE!
I made obj_solid_s to grab it and it does it but only one on the board (I have 5 obj_solid_s on board) and in the same place (in the middle of obj_solid_s) and from anywhere on the board.
I no a PRO, somebady can help me?
Second problem:
!Interest me too how change this:
//Position of rope where we clicked
grappleX = mouse_x;
grappleY = mouse_y;
when i dont use mouse.!
Thanks for helping anyway...
I make something like this:
obj_player
CREATE
GML:
active = false;
mx = x;
my = y;
grav = grav_default;
grav_default = 0.2;
GML:
// HOOK
if keyboard_check_pressed(ord("D"))
{
if(instance_exists(obj_solid_s))
{
active = true;
}
}
if (active = true)
{
grav = 0.1;
x += (mx - x) * 0.1;
y += (my - y) * 0.1;
}
if keyboard_check_released(ord("D"))
{
active = false;
}
if(active = false)
{
grav = grav_default;
}
GML:
draw_self()
if (active = true){
draw_line(x,y,mx,my);
}
Last edited: