• 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!

collisions

  1. D

    GML Top Down Shooter Collisions

    Here Is my movement code: var _dist = 20; //this is how close the player can get to the target var _move_speed = 4; // How quickly to move towards cursor - must be less than _dist var _direction = point_direction(x, y, mouse_x, mouse_y); // Get direction to target var _distance =...
  2. D

    move_and_collide issue

    Here is my current movement code: //(Create Event) move_speed = 2; tilemap = layer_tilemap_get_id("collisions"); //(Step Event) if keyboard_check(ord("W")) { var dir = point_direction(x, y, mouse_x, mouse_y); var x_speed = lengthdir_x(move_speed, dir); var y_speed =...
  3. D

    Top Down Shooter

    I am making a top down shooter, however the way I have decided to make the controls is proving to be an issue especially when seeking help as most people use arrows/wasd for movement. In my game the player moves in the direction of the cursor using the w key - I have coded this but am yet to add...
  4. D

    How do I make tile set collisions

    I have a player object - player1, that moves in the direction of the mouse when the W key is pressed. I also have a tile set - TileSet1 that I have used to draw an outline on my room where I want collisions to take place, on the tile layer - Collisions. How do I make it so that when the...
  5. S

    Slope Collisions in GameMaker with push movement

    I've tried a lot of solutions to work with, but couldn't get it fully to work. If you don't get what I mean with, it's basically a slope collision, but it pushes you automatically when you collide with it. Example: If the X and Y scale of a slope is over 1 ( basically if the slope looks like a...
  6. pamelahoward

    I messed up my collision code, not sure where?

    I was following both of these tutorials to achieve an RPG style game: GameMaker Studio 2: RPG Movement GameMaker Studio 2: Easy Tile Collision System Somewhere, somehow, I messed up. The player object is not colliding where the gridX or gridY is great than 0: Here are my code blocks...
  7. S

     Help refining wall collision

    Hello, I've seen many people use multiple strategies to tackle the issue of wall collision. In my case, I've used this code: var _collision = false; // horizontal collision going right if (sign(hspd) == 1) { if (tilemap_get_at_pixel(collisionMap, x+hspd+(4*sign(hspd)), y)) { x -= x mod 4...
  8. M

    Tilemap Move and Collide help

    Just saw the new move and collide feature that allows for tilemaps I can get it to work by placing tiles in a room manually, but if I create a layer and new tilemap using GML, the tilemap appears correctly but the collisions no longer work... how would I accomplish this?
  9. L

    Collision Functionality

    Within the create event panel of object1, If I select "collision" > object 2, a collision takes place between object 1 and object 2, and assign jump2point 0,0, relative, relative, the collision is smooth, laterally. However, if I go into the object 1's step event and add detect any object >...
  10. D

    SOLVED Smooth collisions and sliding along walls

    Hey everyone, this problem has been plaguing my project for a while now. I'm essentially making a top-down shooter with a 3D viewpoint, similar to Wolfenstein 3D. While I was able to figure out how to stop the player from moving through walls, moving along them is very jittery and I want to make...
  11. J

    Tricky Collision bug

    I am making an arena shooter based off of the tutorial made by Mark Alexander. I wanted to add walls and collisions to my project to add a layer of complexity to the game. In order to do that I had to change the movement system in order to get rid of a bug where the player would get stuck on the...
  12. D

    Collision/Draw Sprite/Array problems

    Ok so I have several things that I need help with so I figured I'd just put them all in one post (disclaimer: I'm bad at explaining things so sorry if I forget smth important). 1. I FINALLY figured out this collision problem I was having and it kinda works but still has one bug. The code is...
  13. F

    Collision

    good, I have always had errors with the collisions of my objects in gamemaker, they are enemy/player mobile objects and I always fail, sooner or later the object crosses the collision, is there any code that facilitates this? the cleanest, easiest, functional, effective code?
  14. J

    Collision Rectangle Not Colliding with Objects

    Hello, I am trying to perform what should be a fairly simple collision. Essentially, I have instantiated a grid of 32x32 squares covering the entirety of the room. Each grid tile (GridTile) object has the attribute 'occupied' which is a boolean storing whether or not another object is present...
  15. Rook

    multiple object collisions

    Hi I am trying to add multiple object collisions in order to be able to avoid parent conflicts. For instance: var _entityCount = instance_position_list(x + hSpeed, y, obj_wall, _entityList, false); I also want to make an object called par_entity part of the instance count, I tried using...
  16. S

    Beginner collision problem

    Hello, I have created a collision tile map, but the code below had a weird quirk where the player object will jump through a barrier to the right or repeatedly skip backwards when colliding to the left. This only happens when the barrier is placed in particular spots in the room. The issue I...
  17. Solthall

    Collisions when moving in mouse direction

    Hello guys! Any tips on how I can make collisions work with the following movement code? I'm moving the player with w,a,s,d, all relative to the mouse position. So if I press "W", the player moves towards the mouse pointer, and away if I press "S". "A" and "D" will make the player strafe...
  18. Z

    Collisions with objects + sliding on walls

    Hi everyone. I'm trying to make collidable objects, of many different types. For now, I'm using walls as a test case. What I want to do is this: the player should collide with a wall object and still be able to move except where there is a wall. This is the setup (that can not change): 1)...
  19. D

    GML Visual Sliding around a box in top down shooter

    I am making a space shooter with indoor rooms, and when my ship collides with a surface, I want it to slide either up or down or left or right on the object, depending on if the surface is horizontal or vertical. In this video, you can see that I have figured out how to get the ship to slide...
  20. Kyrieru

    GameMaker Fastest object-based platforming collisions you know of?

    When GM2 rolled around, I made the switch to tile based collisions. For a while I was like "Woo! Faster code! tons of things on screen!" And then after using it for like 2 years that turned into "God I wish I didn't have to jump through 10 hoops to do anything at all" So I'm thinking of going...
Top