1. Marquitos3000

    GMS 2 Collision problem

    Hi, I´m making a tile based collision system and I use this script: var _collision = false; //Tiles horizontales if (tilemap_get_at_pixel(collisionMap, x + hSpeed, y)) { x -= x mod TILE_SIZE; if(sign(hSpeed) == 1) x += TILE_SIZE -1; hSpeed = 0; _collision = true; } //Cometer...
  2. otterZ

    SOLVED Why can't I change my included file sprite's origin to middle centre?

    I'm externally loading a sprite from an included file and want the origin set to Middle Centre, but it is drawing with the origin set to Top Left (0,0) ??? Here is the code in the Create Event: exe = sprite_add(working_directory +...
  3. Axl Trauts

    SOLVED Get center of every children of Parent_Enemy instance

    Hi, I have a top down shooter and I have this special gun that shoots sticky bombs from above. The should appear at the middle of every enemy instance using its parent par_Enemy. Each enemy has different origins due to their unique behaviors, so using something like this on the script that...
  4. sv3nxd

    SOLVED draw_sprite_general weird behavior

    I draw a sprite rotated and horizontally flipped. I do it with draw_sprite_ext and with draw_sprite_general, but I get a different outcome with each, despite having the same variables. With draw_sprite_general, flipping the sprite seems to set the origin to center? I don't know and I can't...
  5. Palocles

    [solved] Moving Platform, reversing direction

    I'm trying to do my moving platforms with an x (and y) origin point and destination point and have them flip direction at each end. Have tried these two codes but it doesn't reverse direction. if (horizontalMove) { if(x < xDest) x += hSpeed; else if (x > xDest) hSpeed =...
  6. Z

    Asset - Demo Now released! Pixel perfect sprite rotation around any pivot point

    I really hope this helps people, I worked hard on this one to figure out all the math, and make is as simple and as elegant as possible. This is very readable, compact, but incredibly powerful when it comes to rotating sprites. https://marketplace.yoyogames.com/assets/8364/sprite-rotation-toolset
  7. B

    GMS 2 SOLVED: Sliding under low ceilings/barriers in platformer: collision problem

    I've given my player in a platform game a slide attack, and it seems to be working pretty much how I want it to in regard to using it to attack enemies. I'm using the following player state script: x = x + hsp; y = y + vsp; vsp = vsp + grv; //Horizontal Collision if...
  8. FacesOfMu

    GML Isometric RPGs: Tiles and Sprite Origins

    I'm not sure if this should be posted in Programming or Game Design threads. I'm wondering what the norm is when it comes to deciding the origins of sprites for an isometric RPG? I've got sprites that will be drawn in both inventory and in the room grid. When they're in the room grid, I need...
  9. Suzaku

    GMS 2 Origin: midle centre or bottom centre?

    Im makinng a platform game with a bit of fighting game style, and I wonder which origin is the best for this kind of game. Im asking specifically for moments like when changing sprites when doing moves, and positioning objects, etc.
  10. Hudsonius

    Easy way to edit multiple origins at once?

    So all my original origins were centered, but as I started doing shading, I realized bottom centre would work a lot better. Is there any easy way to manipulate all these objects? (I have hundreds) I've tried using sprite_set_offset(sprite_index,x,y=16); and selecting the groups of objects I...
  11. J

    GMS 2 Weird error

    Hey guys! My error is very weird. Here a screenshot: The problem's, that var origin_x = sprite_get_xoffset(sprite_index); var origin_y = sprite_get_yoffset(sprite_index); doesn't work.. That did a friend for me, I have no clue, what that means. Please help me and maybe explain to me. (sorry...
  12. B

    Help with sprite and jump through platform!

    Hi guys, I got a few problems with my character's sprite and the platform. First of all, the platform can be jumped through by the player when it is under the platform. Secondly, if the player has stood on the platform, the platform's mask index changed into 1. Also, note that when I first...
  13. G

    Drag And Drop [SOLVED] My bullets aren't lining up with weapon direction/angle

    Hello guys! Maybe yall have the answer to this, I've tried a variety of things but it still doesn't work :/ [GMS2] My obstacle: I have 4 sprites trying move together at all times. Legs-Torso-Rifle-Bullet (2D side view perspective) My torso should follow/rotate wherever my mouse is located...
  14. L

    A way to dynamically change object origin to match sprite in animation?

    Greetings, My first forum post in over 10 years <3 I'm building a game and was unable to find anywhere on the internets how using gml we could move the Origin (+) that is defined in a sprite which contains a series of image indexes to be consistent with the animation when played(to have origins...
  15. Geners

    Flipping sprite on Xscale with origin at 0,0

    So I decided I didn't want to change my origin to the center in order to flip an image and have it stay in the same position so I said "I will just write in the adjustment post xscale flip" WHAT A RIDE Can someone explain this to me? So my original idea is that if I moved left I would...