coordinates

  1. S

    GML Clever bullet

    Hello everybody, i wanted to make clever bullet. The bullet, knowing the speed of the player and the direction of his movement, with the condition that the player does not change either the speed or the direction. Must calculate the angle at which it will fly out to intersect with the player So...
  2. reizzar

    GMS 2.3+ Player Object Position After Room Transition [SOLVED]

    Hello, hello! Fairly new to the GMS universe, but learning and loving every minute of it! I am working on a platform style game and having a bit of trouble with where my player object ends up after a room transition! I followed along with Shaun Spalding's GMS2 "Room Transitions using Sequence"...
  3. giraffeman210

    GMS 2 Instance Create based on Viewpoints

    This seems simple and yet I can't find anything about it. Is there a way to create an instance based on coordinates of a viewpoint? Say I have a room a few screens wide yet no matter where I am I want to create an object in the middle of my viewpoint? Is this possible or can I only draw things...
  4. LittleAngel

    Convert a screen coordinate into a 3D value

    Hi everybody ! I'm looking for a script converts an x,y screen coordinate into 3D coordinates with d3d_set_projection (GM 1.4). For example the middle of the screen is x=512 y=384 (for a 1024*768 screen). I would like this middle of the screen (the pointer in a fps game) return the x,y,z values...
  5. K

    SOLVED Player spawning to wrong x,y position upon loading

    This is my first forum post here, so if I neglect to put any important code please tell me and I'll try to include what's needed. I'm working in GameMaker v1.4.1804. I've followed Shaun Spalding's JSON based save/load tutorials and I'm run into a problem. Whenever I load my game, when I go to...
  6. Z

    Sliding Door Issue

    Lately I have been having issues with implementing a sliding door mechanic I checked the code and it looked bulletproof but yet when put into practice it does not work. in the Create_Event I added a variable "stop = false;." and a Alarm function that sets that sets the stop variable to true...
  7. flyinian

    SOLVED Unable to place a X & Y room coordinate to an object

    Object1 will spawn correctly, while object2 won't be affected by the given coordinates given in its create event. Object2 will remain at the x & y coordinates that it has in the room editor. I have many other object using this system and it seems to work fine. I gave object2 coordinates of my...
  8. V

    How do I get these two co-ordinates?

    Heyall I'm using the draw_sprite_pos function to draw a sprite on an angle according to a top-central horizon point. With the help of image scaling I have determined the top left and right two circles and their respective x and y positions. (green) as well as the bottom blue circles y...
  9. Dwighty4000

    GMS 2 Why do the "x" and "y" jump back?

    Why do the "x" and "y" jump back if the player ends to walk I have a player object and I have a flashlight object. When the player is walking, the coordinates are taken over by the player and expanded to their "x + 100" and "y + 20". But if the player is not walking, then it takes over the same...
  10. Lady Glitch

    GMS 2 Manipulating with Asset Layer elements using Code

    Is there any way to get / change sprite's coordinates / scale / rotation in Asset Layer using code? Something like: var a = layer_get_all_elements(layer_get_id("AssetLayer")); for (var i = 0; i < array_length_1d(a); i++;) { if layer_get_element_type(a[i]) == layerelementtype_sprite {...
  11. Carcophan

    GMS 2 Destroy projectile at specific tile location

    Hello everyone. I am new to GML and GMS2 but am in love with everything and the amazing community. So, I am already able to successfully shoot a projectile object, from the players location/gun, towards the mouse click location/enemy. (In a top down 2D shooter type game). However, I am...
  12. Z

    Spritesheet coordinates vs single sprite image index

    Hi everyone. So I'm passed the point of initial learning and I decided to start over again, now a bit more professional. I had a project going that worked really well, but the code was extremely sloppy and became too chaotic to handle anyway. Now one of the more important things in my project...
  13. B

    Windows Check Position for Draw Event

    Hello, I am wondering if there is a way to check a coordinate for the draw event? I want to make an if statement that performs like this: if any object's draw event is drawing any sprite meeting with this coordinate, then perform the code between the curly braces. Is there any way to do this...
  14. F

    GML how to store multiple kinds of instances with their x and y coordinate

    basically what I'm trying to do is make it so that when the player presses Z, each instance of every object parented to a parent object is stored but is no longer in the room and a new setup is drawn, and when the player presses Q, the new setup is stored and the old one is shown and i need to...
  15. AiNaKa

    Legacy GM Help using draw_sprite with relative coordinates.

    Anytime i use draw_sprite using relative coordinates such as: "draw_sprite(sprite,0,x,y);" The sprite will become displaced as the object moves, but i want the sprite to stay fixed relative to the object, and the problem is even further amplified when dealing with views in a room. Is there any...
  16. Steve Potts

    coordinate passing.

    Hi folks, I`m having a bit of bother, I think I use `other` but not sure. I`ve got an object and it moves with keys and rotates, easy enough. I have another object and I want to position it at the same place and angle( so it is on top of it and moves and rotates with it.) , how do I pass the...
  17. J

    Get coordinates of collision for minigolf game

    Hi all, I'm looking for a way to to detect the exact coordinates at which a collision between two objects is happening. I'm making a game similar to minigolf, so I need to set the bouncing direction as accurate as possible when the ball collides with a wall or other object. In the image I...
  18. D

    GMS 2 How to move a object to a coordinate

    So, im really new with the engine and I have really little experience with java so i ask sorry beforehand for my english and my newbie skills. Anyway im trying to make a title screen, so I made a sprite with the the tile put it in an object and put it in the first room, I made some lines of code...
  19. Carbiner

    GML Coordinate Scaling Problem

    Hello! I'm having a little bit of a coordinate problem. I'm trying to use a 'heat map' to direct my unit objects. Head for hot sectors, avoid cold ones. It's not really working. They always head for the top left corner. I believe this is a scaling problem, but I don't know what to try next...
  20. M

    GML [SOLVED/BUG]Persistent Objects on paths, moved during room switch.

    Hello, So at the moment Im working on a game that has multiple enemies with set paths in room 1. They are currently set to persistent. When I go to room 2, the paths are unaffected, but the instances are all moved. The y being the biggest change which changes it to minus whatever its y was...
Top