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

movement

  1. C

    SOLVED Simple collision with vehicle controls?

    Hey all, I'm currently creating my first-ever game with GameMaker (v2.3.0.529), and have encountered a pretty tough problem (for me, at least). The game I'm making is going to be fairly simple - the player will take control of a car and try to hit moving targets. I've just arrived at the point...
  2. UberhenriK

    GMS 2.3+ Movement direction variable?

    Hello there, I'm creating a topdown game, and i want create some kind of variable that stores moving direction of character depends of it X speed and Y speed. I want use this var to rotate the characters sprites, collision and for other useful things. Unfortunately i have no idea how to do...
  3. DrNegative15

    GMS 2 Issues with 'Movement and Collision with Multiple Moving Objects'

    Issue 1: Order of instance code execution affects movement behavior. Visual Aid for Issue 1: Scenario: 4 block instances are lined up one directly behind another and all are going to move together in the same direction. First they will all be moving to the right. (left side of...
  4. B

    Move towards point in specified units

    Hi, I have been trying to find the answer to this and have been unsuccessful, hoping someone can help me solve this! I have an object and I want it to move towards the direction that my user taps on the mobile device. I want it to move for only a specific amount of distance, say for example 10...
  5. A

    SOLVED Player object moves to the right without any inputs

    I'm having a strange thing going on with my code. This is the code I usually rely on to move my player object. However, it now moves to the right on it's own when no key is being input. If I press the key to go left, up, or down, the object stops moving to the right. You can test it to see the...
  6. E

    GMS 2 GMS2 acceleration_to_point

    Alright, here's something I thought could be extremely useful IF I could ever figure out how to make it. A piece of code where an object moves from one point to another smoothly without just jumping to the co-ordinates. This is the base I'm working with. Any ideas on how to continue this? (I'm...
  7. ShadowLenz

    4 directional movement question and how to make his collisions

    I'm making an old RPG style (like the first Final fantasy) is "motion_set" the best way to make a 4 directional move? i dont want to make a eight directional movement, just up, right, left, down with not diagonal direction. and the collisions are well scripted? the character's movement is...
  8. E

    Using Sin with move_towards_point.

    I'm currently learning to use Sin from an old post from Gre_Lor12: https://forum.yoyogames.com/index.php?threads/vertical-sine-wave.8185/. This is the code: var Amp = 20; //How "Stretched" the wave is var Freq = 10 //How much to increase the waves amplitude by (in px) x = xstart +...
  9. J

    (Solved)Rotate Player movement with camera view rotation

    So atm i can rotate the camera and the player matches the camera angle, im trying to add/subtract the angle of the camera view to the movement code of the player. if i rotate the camera 180* and move the player up, it will actually be moving down, because its not taking into account the...
  10. mikke

    GMS 2 Can't get my player sprite to move horizontally

    So I'm SUPER new to GMS2, and all game programming really, so I'm probably making a rookie mistake. I'm following Shaun Spalding's complete platformer tutorial and have copied the code character for character to add movement to the player object, albeit with adjustments for the numbers in his...
  11. P

    GMS 2 Unbiased 4-Directional Movement With Diagonal Movement

    Hi there So I want to have 4-directional movement but still allow for diagonal movement. It's just basically the movement Undertale has but I just don't know how to make it work properly. what I have now is: /// Create Event plyrspeed = 2; // I need to work with directions like this because I...
  12. Hypotakt

    SOLVED Neat collision handling with using sprite masks (in GM:S 1.4)

    Hey guys, I am obviously searching for a smooth collision handling system for my game. I spent a lot of time today, finding a good way to implement, but had no success yet. The game character is moving per direction and speed, but it has only 4 different directions in sprite (left, right, up...
  13. M

    how do i make my character movement more smoother?

    how do i make my character movement more smoother? like car speed from slow to fast. could you please write the coding, i really need some help
  14. M

    GMS 2 Character movement thing

    So my character that im playing as is weird. When i first hit "d" (right) he teleports a meter away before starting to walk. Same as when i press "a" (left). It annoys me because it makes the game kind of ****. How can i fix this?
  15. FoufaDjo

    SOLVED collision,friction and accel problems

    i followed a tuto on yt about movement and the dont use the speed var so i cant use the friction function can someone help me: hspd = (rkey-lkey); vspd = (dkey-ukey); if (hspd != 0 or vspd != 0){ dir = point_direction(0,0,hspd,vspd); hmove = lengthdir_x(spd,dir)...
  16. Mike?

    Issue with dash mechanic for movement

    Hello! This is my first time posting here and I'm in the middle of building my movement in Game Maker studio 2. I have horizontal movement down, however I can't seem to get the dashing ability work properly. In the create event, pretty straight forward stuff: move_speed = 300; key_left =...
  17. COMMANDERY11

    How do I make my platformer game, act like a platformer game?

    In traditional platformer games you would have a rectangular room where the player can move left or right. And depending on which direction you move in, more of the level will be revealed to you, as you go. How do I do that in gamemaker? As of right now, I just have a square room for a level...
  18. kureoni

    help with colision code?

    thats the basic movement code for the obj_enemies if(instance_exists(obj_player)){ mp_potential_step(obj_player.x, obj_player.y, spd, obj_colision) image_angle = point_direction(x, y, obj_player.x, obj_player.y); what i want to do is: when the obj_enemies touch a obj_colision (that...
  19. kureoni

    SOLVED does anyone knows how to make a functional topdown 2d movement script?????

    var move_left = keyboard_check(ord( "A")); var move_right = keyboard_check(ord("D")); var move_down = keyboard_check(ord("S")); var move_up = keyboard_check(ord("W")); if (move_left && place_free(x-spd,y)){ x-=spd; } if (move_right && place_free(x+spd,y)){ x+=spd; } if...
Top