• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

collision

  1. Divinik

    Shaders Only draw part of sprite that isn't blocked by a wall?

    I have a cone of vision for my enemies, and I want it so that the part of the cone that is through a wall doesn't get drawn, and maybe also have a line drawn where it is colliding. Something like this: https://drive.google.com/file/d/1sYwbd0rosreMgZuA9t8khvZcK9nfsyTm/view?usp=sharing Any ideas...
  2. J

    Is there any way to check if a player gets stuck (crushed)?

    I made a platformer with moving platforms, but there is an issue. When I get between the moving platform and a solig wall, I get stuck in the wall. I want the player to die when he gets crushed like this. How can I check for this situation?
  3. D

    Legacy GM How to stop sprite from shaking when following the player object?

    I have an object set up to specifically follow the player object around my game and for some reason the follower object is always shaking when it follows the player and when the player stops moving. If anyone could help me figure out why it keeps doing this and to solve this issue I would be...
  4. X

    GMS 2 (SOLVED) enemy stops moving

    hi there. there are many problems im having with the enemy but this is a big one when i touch the enemy, both the enemy AND the player get stuck. code: PLAYER: CREATE: hsp = 0; vsp = 0; grv = 0.4; walksp = 8; hp = 100 state = PLAYERSTATE.FREE hitbyattack = ds_list_create(); enum PLAYERSTATE...
  5. S

    Legacy GM [SOLVED] Corner Collision Causing Incorrect X and Y Values?

    Hey All! I'm currently working on a recreation of the popular platformer "VVVVVV" and started using the view system in GameMaker to make small, 640x480 levels in my project. These levels are all contained within one room, and when the player walks far enough out of one view it switches to...
  6. DarthTenebris

    Windows Enemy Spawner Logic

    Hello everyone, Currently working on an idea that I have and it involves spawners as a method to bring in enemies. However I don't seem to be able to work out the logic on how to do so. Create Event: ros = room_speed * 5; minRange = 64 * 2; maxRange = 64 * 4; minSpawn = 1; maxSpawn = 4...
  7. S

    Legacy GM A Quirk in Precise Sprite / Object Collision with Filled Squares

    I have discovered a quirk in how precise collision is determined with the collision_line() function. Using a small sprite (8x8) with one color and several frames as a map* for collision, most of which are angled slopes and one frame as a solid block, I learned that this solid block does not...
  8. zampa

    GML Opinion on my line tile collision function

    So i wanted to create a function that checks for tiles using a line, i came up with this: /// @function tile_line_collision(x1,y1,x2,y2,tilemap_id) /// @description checks for collision with a tilemap using a line /// @description it returns true if it finds some collision with assigned tilemap...
  9. Ssnakee

    Legacy GM Charactor stuck in wall if hitting corner, platformer

    Alright, so I am working on a platformer game in which you play as a slime and make your way through levels. I am using a heavily modified version of Shaun Spalding's code. I have many different sprites that I switch between, however I gave them all the same collision box. (Modified). I suspect...
  10. S

    collision problem

    i know this is some very basic stuff but cant seem to wrap my head around it. im making a top down game andtThis is the code i use for movement/collision: vspeed = 0; hspeed = 0; if(keyboard_check(ord("W"))) vspeed -= 4 image_speed = 1 if(keyboard_check(ord("S"))) vspeed += 4...
  11. K

    Mac OSX Hitting invisible wall on vertical collisions?

    Hi there, Total rookie here — So I've done my collision coding and it all works as it's expected to... except for in one direction. If my player is above, to the left or to the right of an object wall, I will collide right up against it like I'm supposed to. But if I come up on the wall from...
  12. EZTALES

    Legacy GM problem changing sprite

    hey yall, imhaving a problem with a sprite change and collsion detection my code is down below and was wondering if anyone could help. basiclly the problem is when a drop of oil falls from the ceiling and lands in my players bucket, it should set the my score which is global.throwbucket to += 1...
  13. Y

    Help reduce life only by 1 hitpoint by collision with enemy (tried immunity)

    need help.. i want to reduce my hitpoint by only 1 hit point when collision with the enemy. What actually happen in my game is that the player reduced the hitpoint by more than 1 hitpoint (usually 4 hitpoint) before immunity turn on. if(immune == false) {...
  14. TheOakNuggins

    GMS 2 [HELP] How Can I Walk Angled Objects?

    Hello! I want to be able to resize this triangle object to any shape or size and be able to walk up and down it smoothly. https://gyazo.com/838978e78c96136101337cc7111c67d5 Example of what I have ^ This is my collision code. I need it like this to handle the acceleration of my player object...
  15. Andrew R. C. Beck

    GML [SOLVED] Ball bouncing off of enemies but they now do not receive damage

    Just as the title says, I'd managed to sort out the collisions of the ball from fine folks here with a place_meeting code in the ball's Step Event: [code] //Collision Checks// //----------// //Horizontal// //-----// if place_meeting( x - 1, y, all) || place_meeting( x + 1, y, all) {...
  16. William Garrison

    GML Collision Issue

    I have had this collision issue with my player for a while. So when I get the the edge of a collision the player (or in this case the enemy) gets either stuck completely or bugs out like in the gif. Anyone know how to fix this? Below is how this particular collision is overlaid
  17. Andrew R. C. Beck

    GML [SOLVED] Trouble getting Collisions working in Step event of Ball

    Hi there folks! :) I am currently working on a game which is a breakout derivative in which the paddle is a ship and the ball is a ball of energy. I am using GMS1.4 and trying this code in the ball's Step event, yet the ball literally just zones through everything which does not have a separate...
  18. S

    Legacy GM [SOLVED] Getting stuck in convex corners

    I tried usong shaun spalding's method of making my sprite able to jump around the platforms. However, when the sprite jumps at an angle it sometimes perfectly hits the convex corner of a stationary platform above it. When it hits this corner, the sprite gets stuck in place until i make it move...
  19. S

    Legacy GM [SOLVED]Player Able to Flip Gravity Twice Instead of Once

    Hey all! As a sort of pet project I've been attempting to recreate the game engine for the popular indie game VVVVVV within GMS 1.4. Everything has been going smoothly so far but I've had an issue for a few weeks now and I just can't seem to figure out how to resolve it. Within my game, the...
  20. K

    Collision/changing movement direction

    I'm working on a project and I cannot figure out this last step. What I need to do is when birdrightobj gets low health, it retreats to nestobj, restores myhealth to 100, and then goes back into attack mode. The retreat part works, but myhealth does not go to 100 and birdrightobj is stuck to the...
Top