• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

grid movement

  1. D

    SOLVED Moving Diagonally Within a Grid

    Hello all! I'm trying to create a movement system where I can move 8-directionally and always land within a grid spot. My grid is 48x48 and I've made a player object with the following code: Create Event: //Initialize player target_x = x; target_y = y; x_spd = 0 y_spd = 0 moving_card =...
  2. dmx0987654321

    SOLVED Can't use player.x = newX to set location of player (this sounds like an incredibly basic problem but I've tried everything)

    Hi, I just want to preface this by saying this is my first time using GMS2 (latest release), and my code is probably a clusterf**k of stitched-together tutorial code and my own inefficient creations, but it works (or at least it did until now). That said, I have consulted the manual and this...
  3. J

    Legacy GM Turn Based Grid Motion Planning

    I've been trying to make a grid-based turn-based movement system for a roguelike. To do this I used to following code: var attack = false; if obj_control.player_turn == false && obj_control.enemy_turn = true && action_done = false { if distance_to_object(obj_player) < 16 { state =...
  4. N

    SOLVED Multiple Objects / Instances Causes Strange Behavior

    This one might be hard to troubleshoot without replicating the problem, but I figured I'd give it a shot and ask the question anyway. I'm basically making an Onitama (Or Chess, Shogi, etc) type game, so I want the player to click individual pieces then click valid spots on the grid to move...
  5. bodilliam

    GML Grid Code

    Hi guys I am somewhat new to GM, and was wondering if there was a easy way to make a snap to grid. There is on Construct 3 and I was just interested in knowing. Thanks!
  6. O

    Grid movement on one axis with a room wrap

    Hi! My goal here is that I have a character that moves in a grid-like pattern left and right by 16 pixels (global.grid_size). What I'm trying to do make it so he can wrap on the x axis of the room. Right now he moves in the grid-like manner back and forth perfectly fine, but as soon as I have...
  7. KyleRansford

    How to Program This Type of Movement? (Example Included)

    There's an interesting open source game project that was built in a different game engine, and I was wondering how the type of movement would be done in GML? Here is a link to a playable build of the game: https://benjames171.itch.io/driller-the-new-fields Basically, it's a grid like movement...
  8. L

    SOLVED Check direction face character before move.

    Hi, I am quite new to GM, I would like someone to help me, you see, I have managed to make my character move in a 16x16 grid, which changes the sprites according to the direction in which I move. But in addition to that I would like to implement the following validation: -When my character is...
  9. Y

    SOLVED Help with grid-based movement

    I'll try and keep this is as simple as possible. I'm making a top-down box pushing/pulling game where once the player makes contact with the box, they are "magnetized" to it unless they scrape it off. The movement in the game is tile-based, so one press of the movement key moves the player...
  10. C

    help request: issues with grid based movement [solved]

    ok so i have been working with different movement types in game maker studio (2.3.0.529) and have been having lots of fun with it. I have finally decided on the code below with one exception, i need them to override each other. See code then see below for more detail. Main step: #region...
  11. J

    SOLVED Target Tracking Issue: Only works when target's X & Y are greater than the tracker's.

    I have a bit of experience with GMS2, so I'm not a baby with it. But as all my coding experience if from GMS2 and Youtube, I wouldn't say I'm proficient either, so bear with me. In theory, my zombie object scans for a line of sight to the player, and if there are no walls in the way, it "sees"...
  12. C

    GameMaker Grid movement for an endless runner

    Hello everyone ! I would like to make an endless runner using tiles on which the character can move. Basically, the character can only move right, so my tiles are moving left. I choose to move only the tiles and not the character, so here is what I struggle to do : When my character wants to...
  13. T

    GameMaker [SOLVED!] MP_ functions unable to path through blocked corners

    Hello there, I've been fiddling with a roguelike for the past few days and opted into using GM's built in path functions to avoid having to mess around with writing a pathfinding system myself. My RL has 8 direction movement and the player can cross over blocked corners but it seems as though...
  14. L

    Need Help/ tile based movement (#noob)

    Hi guys, i'm new to gamemaker so I'm a bit of a noob; sorry; but basically i'm trying to make a tile/grid based game. With movement like pokemon mystery dungeon. So far I have it set up so that when you press W,A,S or D the character jumps to the next tile in the respective direction (each tile...
Top