lengthdir_x

  1. PulseNS

    Legacy GM Trouble using lengthdir to find point on sprite

    Hi, I'm creating a top down game based in space and have the spacecraft booster effects as a separate sprite. The spacecraft has two booster points and I have saved them into an array boosterX and boosterY. My problem is that I just can't seem to get the boosters to line up properly. They are...
  2. M

    Legacy GM [SOLVED]Shooting from tip/barrel of gun

    hello, I'm doing a top down project, however no matter what I do the bullet keeps coming out of the gun barrel, could anyone help me? I'm learning to use the game maker yet and I do not know some basic things. my sprite = x=128 y= 85 origin = x=40 y=49 gun tip...
  3. M

    GMS 2 Lengthdir_x and lengthdir_y

    Hello YoYos I'm trying to change the direction of this yellow orb to move in the opposite direction for 10 frames. It's a collision problem. Every time i collide with the white square, the yellow orb moves to the right. How can i fix this? I'm submitting my code with this thread. t g
  4. Zack

    A video introduction to lengthdir_x and lengthdir_y (a primer for building a top-down shooter)

    GM Version: GameMaker: Studio 1.4 or GameMaker Studio 2 Target Platform: All Download: https://github.com/zbanack/TSE-lengthdir/archive/master.zip Links: N/A Summary: This is The Step Event's (my) brief presentation on the lengthdir_x and lengthdir_y functions in GameMaker: Studio 1.4 and 2 and...
  5. mar_cuz

    GMS 2 How Would I Do This [Picture]

    Hi Guys, I want an object, obj_Character, to follow another object, obj_Leader. The thing is, I don't want obj_Leader to mover further than 32px away from obj_Character at all times. The player will control obj_Leader and it must stay within 32px in any direction from obj_Character. Also, when...
  6. cdgamedev

    GMS 2 [SOLVED] Issue with lengthdir_y

    Hello, I'm trying to use lengthdir_y but when I enter Speed = 16; direction = 45; vspeed = lengthdir_y(Speed, direction); it returns 0. However, when I enter Speed = 16; direction = 45; vspeed = lengthdir_y(16, 45); it returns -11.31 as expected. Am I missing something or is it broken? This...
  7. M

    Pathfinding and roaming states

    I've been using pathfinding for a while now in my game (top down shooter). The enemies are supposed to have 2 different states whenever they are not engaged, idle and roam. While in idle they stay still and while they are roaming they pick a random direction and move there until an alarm makes...
  8. E

    [SOLVED] lengthdir_X/Y help

    So in my game I want to draw a triangle that goes through 2 points in my object. The way I define those points may seam long but it's actually quite simple. I have outlined that in the diagrams I have drawn below (If you can read my handwriting). The code for this is also below, I recommend to...
  9. P

    Collision not being detected with collision_line at specific angles using length_dirx/y

    Hello everybody, Without getting into too much detail on what I'm trying to accomplish with the whole game, I'm creating a rail shooter where the player is able to jump from one rail to another. Using a custom-made collision script (that uses collision_line), the player object tells the rail...
  10. W

    Still can't use this correctly

    What I thought would be easy to do for one of the last 10 monsters I need to complete my line up for the game was a little bug that spawns more bugs and the spawned ones would move around the center bug in a range of 200 pixels, acting as the nest_radius which is drawn in red in the image, and...
Top