Jump to content


DryPlayer222

Member Since 21 Apr 2012
Offline Last Active Nov 01 2012 05:13 PM

Posts I've Made

In Topic: Moving around a point

20 May 2012 - 03:21 PM



Do you mean that the player like walks around in a circle around the mouse??
in that case i have a movement code like that:

// Movement
if keyboard_check(ord('W')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 4;
    direction = image_angle;
}

if keyboard_check(ord('S')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 3;
    direction = image_angle + 180; 
}

if keyboard_check(ord('A')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 2;
    direction = image_angle + 90;
}

if keyboard_check(ord('D')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 2;
    direction = image_angle + 270;
}

Strangely, that doesn't work. :wacko: Maybe I should add more detail to what I want.

Press W, player moves towards the mouse.
Press S, player moves away from mouse.
Press A, player moves left around the mouse (in a circle).
Press D... player moves right around mouse (in a circle).

Because that code doesn't work.

EDIT: Sorry mrroke96. I'm using image_index variable for my player to point at the mouse.  :lol:

Weird, for me that code is working like you want, but if you replaces image_angle with point_direction(x,y,mouse_x,mouse_y), what happenes then


I sorted it out by changing image_angle with image_index, as my player rotates counter-clockwise 360 frames, so I can link direction with subimages. :lol:

In Topic: Moving around a point

20 May 2012 - 12:31 PM

Do you mean that the player like walks around in a circle around the mouse??
in that case i have a movement code like that:

// Movement
if keyboard_check(ord('W')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 4;
    direction = image_angle;
}

if keyboard_check(ord('S')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 3;
    direction = image_angle + 180; 
}

if keyboard_check(ord('A')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 2;
    direction = image_angle + 90;
}

if keyboard_check(ord('D')) = true && distance_to_point(mouse_x,mouse_y) > 0
{
    speed = 2;
    direction = image_angle + 270;
}

Strangely, that doesn't work. :wacko: Maybe I should add more detail to what I want.

Press W, player moves towards the mouse.
Press S, player moves away from mouse.
Press A, player moves left around the mouse (in a circle).
Press D... player moves right around mouse (in a circle).

Because that code doesn't work.

EDIT: Sorry mrroke96. I'm using image_index variable for my player to point at the mouse.  :lol:

In Topic: Moving away from mouse

06 May 2012 - 05:01 PM

Thanks! I was thinking of -mouse_x and -mouse_y, but no, that doesn't work. :thanks:

In Topic: 2 questions

06 May 2012 - 04:58 PM

Make it so when Z is pressed, set an alarm to a short amount of time, and set a variable ( maybe use global.combo) to 1. Also make it check that variable beforehand, and if the variable is 1, it will do attack 2 and set the variable back to 0.

EDIT: This is for Question 1.

In Topic: Subimage difficulties

21 April 2012 - 11:12 AM

You could go with something like Key release event - image_speed=0, or change sprite to a standing sprite.


Good idea. Thanks a lot.