lengthdir_x

  1. J

    GameMaker Gun attachment position help - Lengthdir_x&y

    Hi I have a gun object with 4 attachments. For the attachment positions I am using lengthdir_x & lengthdir_y, with added code in relation to the angle and xscale of the gun. At the moment, the stock and barrel attachments of the gun work perfect. The problem is the grip and mag coordinates...
  2. MartinDan98

    Windows Lengthdir Calculator

    Hi Game Maker lovers! I created this tool for lengthdir_x and lengthdir_y visualization. So you don't need to guessing direction and distance anymore! You will just put your image in that tool and create points. Then all you need to do is click on export button and it will give you a GML code...
  3. Warspite2

    GML lengthdir_x lengthdir_y

    I worked with lengthdir_x and lengthdir_y off and on through the years, so im a bit familiar with it. That said, I haven't figured out how to make something offset on the y. Example, I have deck guns on a ship, forward and back and they are centered on y so they do just well when the ship turns...
  4. 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...
  5. 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...
  6. M

    GameMaker 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
  7. Z

    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...
  8. mar_cuz

    GameMaker 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...
  9. cdgamedev

    GameMaker [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...
  10. 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...
  11. 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...
  12. 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...
  13. 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