# direction

1. ### GML Elliptic Direction

Hello there! how was your day? Ok so, I am having problems with the GREEN CIRCLE following the direction of the BLUE LINE The BLUE LINE point to the direction of the mouse and have manage to make the GREEN CIRCLE follow Elliptical trail of WHITE CIRCLES The WHITE ELLIPSE mimics the direction...
2. ### GML Find Point on Rotated Ellispe Sprite Contour

What formula would find the contour (aka edge) of a rotating ellipse shaped sprite (assume a center origin) starting from the sprite center and in the direction usually of the image angle? I know lengthdir_x(len,dir) and lengthdir_y(len,dir) would work for a circle sprite, or on a non rotating...
3. ### Problems with the angle of a drawn line

So, recently I put in my spaceship game a bomb system, which the player can drop to destroy nearby targets. Before the bomb is dropped, a line is drawn to show the bomb's path. But I noticed that this line is not being drawn at the correct angle of the bomb's path. Here is the code for how the...
4. ### Smooth Sprite Direction Change?

Hello there! Hope you are all doing great. It's been a long time since i asked around forums about this specific issue i had but sadly those posts most likely no longer exist and my project was lost as well so deja vu i guess. Anyways straight to the topic. Is it possible for anyone to help...
5. ### Object Speed Relative to Direction

I'm creating an explosion of instances that start at a center point and move outward. I set the direction to random(360) and a speed of 20. The instances spread out in a even circle from the center at the same speed. I was wondering if its possible to set the Speed relative to the Direction so...
6. ### SOLVED Event collision problems involving multiple instances.

Hello again! I'm here because I'm having problems with my game's collision event. Basically, I'm trying to simulate a starfield that works like this: I have an object called "obj_star", in the game, it is spawned by "obj_starcreator", which spawns a star in a random place on the screen. And so...
7. ### direction problems with enemy object...

So in my top-down game sometimes the enemies run away from the player. I added mp_potential_step to the enemies' running away code, but then it got difficult. I had to somehow add the directions away from the player to the enemies' mp_potential_step_object() code. this is to make the enemies...
8. ### Legacy GM lengthdir_x,y help

Heyall, I'm trying to skip the trigonometry because it's just not working for me regarding all the different negative numbers i'm working with. I want to jump from x,y1 at an angle (direction) of 280 degrees and 100 pixels in said direction in order to land on x,y2. I cannot for the life of me...
9. ### Change direction attacking

My character when attacks, he turns only to the right. I can't make he turns to left and attack looking to left while walking. He turns if he's stopped, but if he's not, the animation change to the right. if keyboard_check(vk_space){ sprite_index=character_Attacking_Right;image_speed=1; }...
10. ### GMS 2 [SOLVED] Discover 'direction' with hspeed and vspeed positions

Hello! I am trying to discover the direction variable having the hspeed and vspeed positions. Since if you use hspeed or vspeed the direction variable gives 0. I'm a little lost, can someone help me? :S Thanks in advance ^^
11. ### instances remain static after assigning a speed of 8 and direction of 90, why?

Hello Community This beats me. I have converted a game from GM 1.4 to GM2. Game worked fine in GM1.4 but now all my instances that have speed assigned to them do not move! for example i shoot bullets they remain static on the screen. GM Support refuse to help even tho the bug appeared after...
12. ### how to check if the player is facing an enemy

Hey guys, this one I thought would be simple, but since 'if direction = point_direction(x,y,enemy.x,enemy.y)' etc. is a 'malformed statement' and I cant figure out anything here... how do you check: if obj_player is looking in direction of obj_enemy : stuff happens? thanks beforehand!
13. ### How do i achieve "slippery movement" / difference between two directions

So i want to create an enemy AI that charges tword a player but has like a simulated friction/delay. kinda like as if it were running on ice, so it starts still and builds up speed in your direction to try and ram you. But if you dodge him he shouldnt continue moving tword you but in the...
14. ### [Solved] Image-Angle affecting direction in Space Rocks tutorial

I'm currently going through the space rocks tutorial and am creating the asteroid's behaviour. The tutorial tells you to change the object's image_angle each step to create a rotating effect, so that it doesn't affect the asteroid's actual direction value. When testing this behaviour, the...
15. ### Object Sprite Direction Tutorial (8 Directions)

GM Version: Studio 2 (Possibly later versions of Studio 1) Target Platform: Any Download: None (Code below) Links: round(), point_direction(), switch, sprite_index, image_speed Summary: Hello all I'm going to show you how to change your Object's sprite, based on direction. It all starts...
16. ### Trouble with direction and horizontal speed

I'm having trouble correctly programming the direction I want one of my objects to move. When Z is pressed, Obj_player_head is supposed to move the direction relative to what obj_player.image_xscale returns (this being 1 or -1). The problem is that while it does move to the right when Z is...
17. ### Path and image angle and direction? How do I combine them?

So I have a path set... and I have my object on the path... and I have the sprite set to go along with it... How do I make the image rotate to follow the path it is going on? It seems like there is just something easy I am missing but for the life of me I haven't been able to find the correct...
18. ### [Solved] Issues with Paths, Direction, and Animation

For context, I'm working on a top-down, tactics-style game. While the player is in battle, they pull up a menu, and to move, the player selects "Move" from the menu. From there, a grid selector is created, and each time the selector moves, it adds a new point to a created path. When the player...
19. ### GMS 2 [SOLVED]keep same direction when colliding with wall

when the object move to the left and collide with the wall he stop moving but change is direction to 0 how can i fix that spdmax = 2; accel = 0.5; friction = 0.3; if rkey hspeed += accel; if lkey hspeed -= accel; if dkey vspeed += accel; if ukey vspeed -= accel; speed =...
20. ### GMS 2 [SOLVED)How can i save previous value of an variable

am making a knockback system and am stuck at returning the knocked player direction to his original direction here is the code: //Knockback knockback = max(knockback-3.4,0); if knockback = 0{ knockbackon = 0; } if knockback > 0{ knockbackon = 1; } if knockbackon = 1{ direction =...