• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

collision

  1. S

    GML Calculating a non-axis aligned bounce/reflection vector for collision resolution

    Non-axis aligned 2D reflection vector GM Version: 2.3 (demo is for 2.3 but the concept would work in any version) Target Platform: All Download: A link to the freely available source code and project is available here: Links: Tutorial Video and Github link Summary This video tutorial builds...
  2. FullCup

    SOLVED The Moving Platforms Trouble.

    I finally made a 'one-way block' right. Here is the collision code without the 'movement': //Instance var plat = collision_rectangle(bbox_left,bbox_bottom,bbox_right,bbox_bottom +abs(vspd) +1,argument0,1,0); //Condition if (vspd >= 0) and (plat != noone) and...
  3. W

    SOLVED precise collision problem

    So in my game, when a player hits a wall with a weapon, it makes a spark when and where the player hits wall. In the following code, everything works as intended EXCEPT that the spark is never made at the right y coordinate (i in the for loop). The sprite stops at the good time (ie it doesn't...
  4. paulog

    Legacy GM Check collision with all objects but self?

    Hello! I'm making a simple game in GM1.4 and I want to check if an object is colliding with any other object but not with itself. This is the code I'm using: if position_meeting(x,y,all) { global.free = 1 } if !position_meeting(x,y,all) { global.free = 0 } Tha variable global.free is always...
  5. Dilawlaw

    SOLVED Problem with my mask position

    Hi guys, I am working on an 8-bit game and I have a problem with the collision mask of the player where it's not situated exactly as I see it on my sprite. I wrote a code to draw a rectangle showing my collision boundaries ( bbox_left, right top, and bottom). here is a zoomed picture of how the...
  6. P

    SOLVED How to compare return of the parent_get function

    Hello everybody, probably the heading for this thread sounds strange but I Really have troubles when dealing with function object_get_parent and object_index variable, so what I want to achieve is simply make one object perform the action depending on what it collided with, so For Example, if...
  7. J

    GML Odd Numbered Mask Dimensions and Tile Collisions

    Hi all, Context: Getting back into a game maker project after over a year and was playing around with some code and functionality I have posted below (not sure what happened to my old forum account but had to register again even though I have on here for at least 5 years now?). The code...
  8. Queble

    2D Tile Collision help

    So I'm making a game where the player needs to collide with walls and stuff, right? I watched every tutorial online, but there are none that show what i want (a player that can collide with tiles using his bounding box) So I came up with this code, and the X dimension collisions work most of...
  9. mizugori

    GMS 2 Need help with tilemap for collision (when I create the tileset, it does not show my colored tile)

    Sorry if this is a dumb question. I am trying to have large curving walls in a scene, and I want collision on them (no objects should be able to pass through them.) At first I tried just putting a huge object, complete with it's own massive sprite, into the room for each wall. However, none of...
  10. mcglubski

    GMS 2 Array for Collisions HELP! [SOLVED]

    Can someone help me simplify this into an array or something else? Even with years of experience with GMS I still struggle to understand simple arrays, especially after coming back to it since buying GMS2. I feel like this should be easy but everything I try doesn't work. If someone could...
  11. Yizzard

    Windows Collision Events not showing up in Debugger

    I've had this problem for a very long time now and have not been able to find anything about it anywhere. Whenever I have a break point in a collision event for an object (example: my collectible object has a collision event that when it collides with a player it is gotten by them) it doesn't...
  12. FranFox

    Detect player landing

    Hi everyone! I'm trying to detect the moment when player lands on a platformer game but I don't understand why my code isn't working. // We've just landed? if place_meeting(x, y + 1, o_solid) and !place_meeting(x, yprevious + 1, o_solid) { show_debug_message("Landed"); } This should work...
  13. Daniel Westberg

    Android GooglePlayServicesExtension & Firebase - GooglePushNotificationsExtension Collision (Duplicate Resources)

    I get a build error after I've added both GooglePlayServicesExtension & GooglePushNotificationsExtension _________________________________________________________________________________________________________________________________________________________________________________ First this...
  14. P

    Collision with particles

    Hiya! I'm making a top-down shooter and one of the weapons is a freeze gun. I've programmed the weapon using a particle system, but now I can't figure out if I can actually make collision events with particles generated by a particle system. Is that even possible? Is so, how do I do it? Or is...
  15. If Programable_Matter

    Elementary Question about Masks and Transparency

    Simple Question. For some reason I forgot how to perform this action... I have a sprite which is a circle and is transparent inside (circle inside is transparent)..... Objects are inside the circle in the transparent area... however when I add a collision event with the object wihitin a circle...
  16. FullCup

    SOLVED Instance_place doesn't work for platforms (one way platform)

    I'm trying to make a platform collision (only from top to down / falling). Well, this code works but when the player collide with other platform inside, he ignores the bottom collision and he goes through it. I Tried to use 'instance_place' but it doesn't work. What i want is to check the...
  17. Lens

    SOLVED Having problems to identify multiple objects with a collision rectangle

    Hello, good morning/afternoon/evening! I'm using a collision rectangle to identify other object instances around the room, and, while there is any of those specific objects touching/being inside the rectangle, the main character (whose posseses the collision rectangle) will change a variable...
  18. M

    Step event collision doesn't work

    So in my game, I can't use Collision Event for obj_enemy because obj_enemy needs to be marked as Solid, and that will stop it upon any collision. So I put the following in Step event to work around it: if place_meeting(x,y,obj_limit){ if escape=false{ direction = image_angle+180 } } The idea...
  19. P

    Object IDs

    Hello, Basically I want to make a system in my game where when I press spacebar a cone in front of player appears and if some object is in front of the player and the cone touches it, it will be collected into inventory (and dissapears from the room). If I simplify what I mean by object lest say...
  20. A

    SOLVED collision check for draw_sprite_ext?

    I'm going to make a game with a lot of sprites. Making all sprites as objects creates a lot of trouble. I wrote the Main rules in a rule object and managed to draw it with draw_sprite_ext. However, I cannot check Collision. Briefly; How to make a collision check of a sprite drawn with...
Top