• 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

  1. P

    GameMaker How to get the coordinates of an enemy instance

    Hi there. I'm butting my head against a wall regarding aiming at a selected enemy My player is a mech divided in two objects (it's a tank right now for testing purposes), the legs that move like in a RTS, and a turret-like body that turns towards a selected enemy, or the mouse if none is...
  2. S

    Enemy Detection

    I'm trying to figure out enemy detection mechanics but can't get it quite right. I have it where if the player is within a certain distance and there is no wall or obstructions, then the enemy will follow if (distance_to_object(oPlayer) <= 256) { if...
  3. L

    I'm having trouble getting the enemy to shoot the player

    I have a script set up so the enemies follow the player when they get close enough I can't figure out a code I can setup in the follow script to make the enemy fire at the player without them spraying just a line of bullets while the player is close
  4. A

    Legacy GM Enemy collision similar to player's?

    So right now, this is my player's movement and collision code for a top down shooter: hsp = walkSpeed * (keyboard_check(ord('D')) - keyboard_check(ord('A'))); vsp = walkSpeed * (keyboard_check(ord('S')) - keyboard_check(ord('W'))); if (place_meeting(x+hsp,y, obj_wall)) { while...
  5. A

    [Solved] How do I stop enemy from knocking back through walls?

    Hello, This is my code right now to knockback enemies in my top down shooter when using a melee attack: var dir = point_direction(x, y, other.x, other.y); other.x += lengthdir_x(argument0, dir); other.y += lengthdir_y(argument0, dir); This is a script that is called in my melee collision...
  6. S

    Destroy Enemy after Fight

    Hi Game Maker Community :)! I have a little problem with my code. I try to make a little Undertale like (please no hate :D) battle system. I tried it this way: I have a enemy, that walks throug a room, if the player touchs it, it gets into a battle-room. As far, the battlesystem works, but my...
  7. Luke Pierson

    Jumping Enemies

    Hello GMC! I've been curious for a while about how to make a jumping enemy ai in a sidescrolling game. Haven't found any tutorials on it yet. I'm thinking of anything from a dog, spider or even a knight that will leap at the player to attack. I'm certainly aware of states and whatnot, I just...
  8. P

    [SOLVED] How to make enemy freeze for a second after script happend?

    So thanks to @Tornado , I have this very good "knockback" script. But now I would like to add a 1 second or 2 second freeze to enemy after its triggered. CREATE EVENT movementStarted = false; movementSpeed = 4; amountOfMovement = 20; hit = false; STEP EVENT: if (hit == 1) { hit = not...
  9. 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!
  10. K

    GameOver - crash.(Solved)

    Good day! I am currently making my 1st game project via GameMaker Studio and I have some troubles with GameOver. In the game there are enemies who create projectiles with "instance_create(x,y,obj_enemy_projectile)" In projectile create event there is...
  11. G

    Help with Beat'em up enemy

    Hello, I have been trying my hand at building a small beat'em up style game much like Double Dragons for the NES. I am currently having trouble with the enemy movement. I have the code currently set up as follows //check left or right if o_player1.x > self.x and //checking if within radius...
  12. Luke Pierson

    Enemy Combo (Solved)

    Hello GM Community! Got a little question for you, concerning enemy states, attacks, and damage code not working correctly. So, the enemies in my game enter attack animations, and when they reach a certain image_index, they create a damage object with a sprite in the shape of their attack. I...
  13. H

    Platformer enemy movement problem

    Im new to Gamemaker and have been following Shaun Spaldings tutorial on making a platformer. i have now completed it and im just adding things and practicing. The slight problem im having is when i change my sprite for an enemy to something other than the square the fear of heights code no...
  14. W

    Enemy Melee Attacks

    I want to know how to do enemy melee attacks with a cool down effect
  15. phillipPbor

    Legacy GM to shaun spalding (if player hit by enemy)

    to @ShaunJS I just want to talk with you, I know you made enemys that collide with player but I just want the player to bounce back from colliding the enemy_par. how did you do that? I just copied your code actually. regardless.
  16. H

    Legacy GM [Unsolved] Sword Collision Multiple Enemy Instances

    So I used the Shaun Spalding tutorial on swinging a sword and checking collision with an enemy and created some code that looks like this: if ((image_index >= 1) && (image_index <=3)) { with (instance_create(x,y,obj_skitter_hitbox)) { image_xscale = other.image_xscale...
  17. D

    Enemy shooting animation

    I am completely new to game maker, i just made an event in my enemy charecter to shoot, it will use variables to shoot every 50 steps with an alarm to make it wait until the variable is true again, howeveri cant get the animation of him shooting to work correctly, it doesn't wait until it is...
  18. P

    Enemies will not move

    Hello. I am relatively new to GameMaker so I decided to sharpen my skills by following this tutorial by Shaun Spalding on how to create basic 'Goomba-like' enemies. These enemies are supposed to move in one direction and change when they hit a wall but simply do not even begin to move. I have...
  19. K

    Enemy Line of Sight Issue

    I'm having trouble with Enemy lines of sight. Right now I'm using an object (obj_enemyVision) as a sight cone being drawn on to an enemy. This works as it faces the correct direction and all, but I don't want them to be able to see through walls. Is there a better way to do this? Thanks.
  20. V

    Getting a variable from one of multiple objects

    Hello, I'm adding knockback effect to my character and for now at least I'm using the direction the enemy is looking to determine the direction the character will be sent by the knockback. The problem is that, having multiple of the same enemy object in the room, the variable will be called...
Top