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

enemy ai

  1. T

    Issue with enemies getting stuck in ground

    Working on a simple 2d platformer, with a mechanic where enemies can be grappled. So far all going well, though I made it so that if while the player is grappling an enemy and they take a hit from another enemy, they're supposed to be knocked back and release the enemy. With how this currently...
  2. O

    Player to Object Collision Issue pt.2

    Hello Im looking for help on a player to object issue. I am currently testing the player to enemy collision and each time I run the game the enemy Character collision box does not register and instead ignores collisions and runs right on top of the player. I do not know what the problem is as I...
  3. 1up Indie

    GameMaker Segmented enemy

    GM Version: GMS2 Target Platform: All Summary: This video tutorial shows you how to make 2 types of segmented enemy in gamemaker studio 2. What are these types? Well, they are like those iconic enemies that you see in a good old mario game. One where the segments are flying after each other and...
  4. Divinik

    GML Enemy/Companion Obstacle Maneuvering Without Paths?

    So with my enemies/companions in the game I'm making (3/4 top down), I'm trying to figure out how to have them maneuver around around walls without paths when one is between the object and the player. The code i have now is: if !collision_line(x,y,player.x,player.y,obj_wall,false,false) {...
  5. R

    Grid Enemy movement

    How would I make my enemy follow the player once the player is in a certain range but make the enemy move on a 16x16 grid. I already know how to make it so the enemy will move towards the player but I want the enemy to move in a grid style to the player.
  6. M

    Enemy Pathfinding(mp_grid) / State Machine Problems

    Hello everyone, I know this question asked many times before and yes I checked old posts and tried different solutions and approaches as much as I could but I'm still learning :/ (I started to GMS 4 months ago, pretty new). I will try to explain my problem. I'm trying to make a topdown shooter...
  7. KPJ

    GameMaker enemy move toward player (GMS2)

    Hi everyone! I need help. I want the enemy to move toward the player if the player shoots within a certain range. At first, all my code was working and the enemy moved toward the player but then all of a sudden it stopped working and the enemy didn't move. //if player shoots with (oEnemy) {...
  8. KPJ

    enemies overlapping? (GMS2) (SOLVED)

    Hi all. I have an issue in my top down game where enemies move toward the player. When there is more than one enemy, the enemies overlap and look like one. Here is my code: //Enemy Create grid = mp_grid_create(0, 0, room_width / 32, room_height /32, 32, 32); mp_grid_add_instances(grid, oWall...
  9. KPJ

    GameMaker Enemy pathfinding

    Hi! In my top down game my enemies use a grid system to follow the player and avoid objects. However, while my enemy is chasing the player the way the enemy is facing is very choppy (it glitches between 2-3 different angles). How can I make it so that the enemy smoothly looks toward the...
  10. KPJ

    GameMaker Pathfinding (GMS2) (SOLVED)

    Hi everyone! I am making a top down stealth game where I want the enemy to chase the player (and look at the player) if it is in within range. I don't want to use move_towards_point or mp_potential_step / mp_potential_step_object as they have jittery movement. So, I tried Heartbeast and Cameron...
  11. KPJ

    GameMaker Enemy ai Gms2 (SOLVED)

    Hi everyone. I an making a topdown shooter, and I want ai to be like hotline miami. I have it so that if the player is within range and isn't behind a wall, the enemy moves toward it with mp_potential_step_object. the enemy moves toward the player, however even if the player is behind the...
  12. KPJ

    GameMaker Enemy AI Movement (GMS2) (SOLVED)

    Hi everyone. I'm making a top down game and I need help regarding enemy ai. I want the enemy to be patrolling a room, but I don't want to use paths. I want it to be almost like Hotline Miami, where the enemy moves forward, and turns left if they sense a wall ahead. Any help or suggestions on how...
  13. KPJ

    GameMaker With statement help (GMS2)

    Hi everyone! I need help with the "with" statement in gms2. I am making a top down game, and I want it to be so that if the player gets in the enemies field of view, the enemy's state will be "alerted". However, I also wanted all other enemies that were within clear view to be "alerted" as well...
  14. G

    Legacy GM Enemy jump, wait, repeat

    Hi everyone, I'm very new to Gamemaker and GML. I've been stuck on this for a few hours now and feel like this should be obviously simple. I am making a 2D platformer and want the enemies to simply jump up and down, wait a few seconds and then repeat. I finally got the jumping part working but...
  15. C

    GameMaker Enemy wandering script.

    I want the enemies in my game to wander around when state == "idle"But I don't want them to wander through solid objects, what would the best approach be to this? This is in a top-down environment!
  16. G

    GML How could I make/program enemies?

    Hi. I'm making a Scrolling Shooter for practice and I wanna know how I could I make enemies. I tried putting the same code of the obj_player in the enemy event and it didn't work. What code could work? I looked for tutorials on YT but there's only tutorials for a plataformer enemy and when I...
  17. N

    Windows enemy attack cooldown

    hello, i have an enemy object with simple state machines and they're working good so far, i want to implement a cooldown mechanic betweem my enemie's attacks but i don't know how, any ideas? (here's my states code) : switch (situ) { case kstates.kidle: { sprite_index = kidle; if...
  18. N

    GML how to code attack cooldown for enemy object?

    hello, i have an enemy object with simple state machines and they're working good so far, i want to implement a cooldown mechanic betweem my enemie's attacks but i don't know how, any ideas? (here's my states code) : switch (situ) { case kstates.kidle: { sprite_index = kidle...
  19. N

    GML My enemy won't die

    Hi , I created an enemy object and gave 3hp and coded it so that when ever there's a collision it subtracts 1 from it's hp, and when the hp reaches 0 he goes to the death state and gets destroyed, but the problem is that no matter how many times i hit the enemy he doesn't switch to death state...
  20. N

    Windows Having a problem with enemy ai

    Hello , am having a problem with my enemy's chase ai,am using state machines and whenever i get near him and he goes into the attack state he animates the attack sprites and then backs away a little bit, here's the code : if distance_to_object(play) < 98 { sprite_index=eattack; } if...
Top