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

collision checking

  1. F

    How to check two objects Collision

    Hi i have some code that checks to see if my player is touching a wall i have two rooms with difference walls and i need my code to check both walls The two walls are called obj_wall and obj_stone how do i do that? here is my code if keyboard_check(vk_left) { if !place_meeting(x - 5, y...
  2. L

    [Solved] Object not loading due to vertical collision code

    Hey, I'm new to gamemaker, and working on my first learn-how-this-stuff-works game. I more or less ripped my vertical collision for jumping straight from but as I wanted to put dashes into the game (including straight down), I wanted a variable which could tell me the player character's...
  3. D

    Legacy GM Help Enemy Not Shoot If There's a Wall

    Hey, Is there a code that will only let the enemy do something to the player if there isn't any solids in between the enemy and player? I'm trying to make it so the enemy can only shoot at me if there is no wall that separates us... Can't find the code for it. Thanks a lot!
  4. Image index and global variables[SOLVED]

    I'm have an issue getting variables to add or subtract during a collision. I have the collision check if the image index, of the other object, is equal to global.state and this works fine when it come to destroying the instance however when it is equal it's supposed to add to global.score and...
  5. D

    Help with Code - Collision

    As an assignment for class, we are creating a game using GM Studio and for a certain part I am required to figure out something with code but I'm really confused and the teacher won't help. Please if anyone can help The object of the game is to have a ball hit a goal to score and win, but it's...
  6. W

    Legacy GM [SOLVED] Specific Instance Burst Emitter Checking

    I currently have my particle system,type,emitter etc setup within a script (Particle_1) which I call upon when obj_small is in the vicinity of obj_ship and the player has pressed space. All of the obj_small instances are moving to the left if !place_empty(x,y) &&...
  7. P

    Legacy GM "Detecting Collision" with Paths; Possible?

    I'm creating a top-down rail shooter where the player has the ability to jump from one rail to another. The rails are all generated with paths for simplicity's sake on my part. My original solution was to have invisible objects ride along the paths, and have the player snap to those objects...
  8. J

    Collision: create dent on an object relative to impact position.

    Okay I don't really know about how to go about explaining this so I will use an example of something that has happened to me recently. A piece of hail fell from the sky and dented my car. How would I go about programming so that when the obj_hail collides with object_car it creates an obj_dent...
  9. A

    Legacy GM Rotating a collision line check [Solved]

    Hi, I am a long time GM user, but haven't been very active on the forums since they were re-made which is why I have such a low post count. I am making a platform game where the player can walk on the walls and the ceiling (or around a circle). Because the player can rotate, down is not always...
  10. M

    Android collision checking problem

    hey there i know its probably super simple or even stupid question but i cant figure it out on my own so im spawning enemies and platforms randomly in front of my player (he's running to the right) and i cant fix this issue that enemies sometimes stands on only one foot. i wanna check if only...
  11. V

    Constant collision checking with appropriate responses

    Hey guys i need help to create a program that will constantly check for collisions in front of it and auto correct it's course to fit it. It will maneuver around a parking lot looking room. With parking spots and everything. The entire program will be autonomous with no actual human...
  12. Reed

    Legacy GM Collision Mask is set incorrectly

    Is there something I'm missing about how sprite_collision_mask works? I'm trying the make a mask that encompasses several instances that move together. The top and bottom instances are called part_top and part_bottom. The mask applies to obj_player. I had thought the code below would create a...
  13. T

    Question - Code Rectangle_In_triangle error? or intended?

    Hello, I need to do more tests, but it seems that the rectangle_in_triangle... doesn't work in the case of the "triangle_in_rectangle"... If the rectangle overlaps only a corner but doesn't have any of its corners inside it, it seems to not return a result >0. Any one could confirm this? Is...
  14. jackquake

     Feature Suggestion/Request - Point of Collision

    In searching the forums on how to determine the point of collision with an instance, there have been numerous work-arounds suggested, such as binary search algorithms, usage of a collision_line for estimation, etc. I'm not at all familiar with the backend of what goes on during a collision...
  15. M

    [SOLVED] Mouse_check inconsistency when using keyboard checks

    Hi everyone, I've recently started using GameMaker Studio 2. I'm playing around with a basic 2D platformer to get used to GML etc... But I've run into a problem when combining keyboard/mouse checks and collision detection. On startup, the bullets shoot correctly when the mouse is pressed. If I...
  16. E

    Basic collision code for moving walls

    Hi, I was making a PacMan style game but where the walls move vertically and horizontally and I've ran into a few problems with the basic collision code I was using. Here's the code I used: for movement I used the basic vspeed and hspeed and the wall objects are checked solid...for the...
  17. J

    Full mask collision using code.

    Is there a way I can use code, not the events, to detect if two objects collide? And please, please for gods sake don't tell me "place_meeting". That object uses the object X and Y and not the whole object sprite mask which is what I need. How can I accomplish this?
  18. S

    Legacy GM Create an object on a collision point between two objects

    So I'm trying to make a little explosion-like animation that should fire when two objects collide, in the point of impact. They're physics enabled and I tried to use phy_collision_points and phy_position_x / phy_position_y but without success, on impact the game throws out an error saying that...
  19. T

    Legacy GM Collisions on a spinning object

    Nutshell of what I'm trying to do: I have a player in the middle of the screen that can only spin in circles. It's mouth can be opened kind of like PacMan, but all of the "enemy" objects fit in its mouth where they can be caught. I used a bunch of lines once the mouth is opened to detect...
  20. B

    Legacy GM Sprite sometimes floats one pixel from the ground

    I ve been doing this game for some months, and the colisions were fine. My character used to jump and fall perfectly, without floating or passing trough the ground pixels. However after some time i realized it is sometimes (only sometimes) walking and standing one pixel over the ground. In my...
Top