code

  1. V4NTT4BL4CK

    HTML5 collision problems

    when my player collides with X walls, he gets stuck there and can't go back. this is my code: #region { sprite_index = spr_1; var sp = keyboard_check(ord("A")) - keyboard_check(ord("D")) if (sp != 0) { if (place_free(x + Sprite4 * 5, y)) x -= sp * 5; if (place_meeting(x+sp,y,obj_wall))...
  2. V4NTT4BL4CK

    GMS 2.3+ Collision issues!!!

    I've been working on this prototype minigame to learn how to use Game Maker Studio 2, but I have a problem that I don't have with other '' walls '' or colliding objects ... when I jump to the roof or platform, my character should stop and return to the ground when he touches the object but...
  3. S

    Discussion speed

    I found out that the speed in all directions is positive in itself and the variable speed reflects the speed modulus or its value, but only I have a function that changes the speed to the opposite, gradually adding to it with the help of motion_add a part of the speed with the opposite sign...
  4. S

    flashing label

    I have an idea to make flashing label. When the player will be near some object (for example rock) there will appear flashing label (press "H" to hide or sth like this). I know how to do it if the label will be an object. But i don't want to make one more object for such thing. I wanted to make...
  5. S

    GML Clever bullet

    Hello everybody, i wanted to make clever bullet. The bullet, knowing the speed of the player and the direction of his movement, with the condition that the player does not change either the speed or the direction. Must calculate the angle at which it will fly out to intersect with the player So...
  6. bodilliam

    GML Grid Code

    Hi guys I am somewhat new to GM, and was wondering if there was a easy way to make a snap to grid. There is on Construct 3 and I was just interested in knowing. Thanks!
  7. S

    Trying to work with motion vectors

    So what is my problem? I want my spaceship (or sth like that) from the start of the game move in one direction with a certain speed. I used motion_set() and it works fine for me. But also i have 2 buttons to rotate spaceship (i used image_angle += *angle*). And the next step is that when player...
  8. S

    GML How do I use the reverse command?

    I need to create something like this: but using code, not DnD™ . How do I use the reverse command? Thanks in advance, and sorry for my broken english.
  9. Yellowhite

    SOLVED Help to object in bad view position

    Hi guys, i recently have created a room of 3840x2160 and i put it a view of 1920x1080 (i can't change this, it's necessary) So, it's look its like thats: So, i have created a object called "Dialogbox" and in the Step code i put to him be like: x=view_xport[0]+12, y=view_yport[0]+24 and so, the...
  10. B

    GMS 2.3+ Code Copying, Deleting, and Pasting in Scripts

    Recently I updated to the most recent part of GameMaker. Before this problem occurred, I already had 2.3, but the most recent update caused this error to happen. Basically, whenever I go into my code the functions within my code duplicate themselves and cause compile errors due to code...
  11. Joifad

    Windows Animation of my character doesn't work properly

    The code I wrote is exactly like this: //Update Sprite function PlayerAnimateSprite(){var _cardinalDirection = round(direction/90); var _totalFrames = sprite_get_number(sprite_index) / 4; image_index = localFrame + (_cardinalDirection * _totalFrames); localFrame +=...
  12. W

    SOLVED Children not inheriting

    I have an object named pPlayerEntity which contains all the keyboard input movements and some information about a player state machine I have set up. My goal here is to have the player control multiple different little characters throughout the game. I thought I would do this by having the...
  13. R

    Draw GUI scaling

    Hi all, I have experienced a number of issues when it comes to drawing graphics to the HUD. The current issue I am facing is a simple sprite scaling issue. For example when I collect a gem I would like my HUD gem to scale up slightly and then back down. I seem to be having problems with it. Am I...
  14. phillipPbor

    GMS 2.3+ Changing pallets

    I wonder if there was a cheaters code for changing palette of the screen of the game? Because I discovered the retro palettes swapper is pricey, so I wonder if there is an alternate way to make the shader that works like pixelated popes. I wanted help making a replica of the pallet swap code...
  15. R

    Code only works on first enemy created

    Hi everyone, I've got a bit stuck on an issue. I have my music change when in a certain radius of an enemy. However it only seems to work on the first instance of the enemy that was created. Any idea why it only works on one enemy? Big thankyou in advance for any help. EDIT: Also worth pointing...
  16. A

    GMS 2 [HELP] Moving platforms

    Hello! I am trying to code a moving platform, however, it sometimes (not always) glitches into place and just...stays there shaking (not touching the walls or anything it might be colliding into). I would like to know what could be causing this in the codes. CREATION: randomize(); dir =...
  17. M

    GMS 2.3+ Room Transition not working

    Hello, I have come from Shaun Spalding's video on Transitions. And I can't see anyone else having this problem except for me. I am quite new to coding so I will have to apologize if it's an easy fix or whatnot. Basically Whenever I go to the end of my room where the OLevelEnd Transition is, I...
  18. I

    State Machines

    Hey guys, First time using GMS2 and posting. I'm running into issues with my state machine. I'm not getting any syntax errors, but the game isn't loading the states. Basically, I can't move after implementing the state machine. Any advice or ideas on what it might be? The project can't be...
  19. Smidy3

    SOLVED Top Down Shooter - Strafing Problems

    Hey Everyone New here to the world of gml and gamemaker. Im making a top down sci fi shooter; The players ship (Proto1) accelerates forward with "W" and reverses with "S" "A" & "D" rotate the ship. and i want "Q" & "E" to strafe left and right, but for the love of me i cannot seem to get...
  20. F

    GMS 2.3+ Hard times with scripts...

    Hello there (and please forgive me for asking something in the wrong thread, if someone can fix that mistake), I hope everyone's doing great these days. I am currently following a Youtube tutorial (you can skip the first half part): Yes, this is the part 2 but I have no issue with the part...
Top