code

  1. S

    SOLVED Hi, beginner here. I have not been able to successfully code my bullet laser i have made to shoot from my ship. Please help?

    I have now been using Game Maker and learning to code in GML for 3 days. Someone else on here helped me with something before so I am hoping someone can help with this. I have tried to code a laser bullet to shoot from my ship, but when I press the space bar that I have assigned to shoot the...
  2. Atbit

    What can I do with sequences?

    1) Is it possible to mirror and rotate sequence animation like in the case of sprites? Like when it's turning 180, the bullet cases flew to the right, not to the left; 2) Is it possible to randomize xy coordinates to prevent the cases from falling to one point? P.S. I don't know why, but...
  3. Gigicom

    GMS 2 Use code in json file

    Hey, I‘m trying to figure out how to use pre-defined json files for some item data in my game. Before, I simply assigned all values to variables and assigned those to a ds_map like this: constantData = item.apple; name = „Apple“; graphic = spr_ItemApple; list = ds_list_create(); listVal =...
  4. B

    GMS 2.3+ Weird Sprite Spawns

    Random Sprites Spawn during my game like those gradients and the main character space ships i have no clue how to fix this, Evan when searched the sprites are used in any code, just background use only.
  5. N

    Is there a way to time code? My A* is too slow.

    Hi guys, so I've implemented A* for my hex grid, but it's too slow, as in, it's causing noticeable lag. Note that each run of it isn't terribly slow, but I have to run it across ds_lists that can get up to a hundred entries long (using it as a pathfinding check). If this were python, I'd throw...
  6. ZacKow264

    SOLVED Opening windows in code?

    Simple question, is there a way to open new windows in code? Like a second window for the game? What are the limitations of this, if it's possible? Does anyone know? This would be in the actual game itself. So I want to basically open another window automatically while the game is running. Is...
  7. X

    Windows <SOLVED> My global variable edit resets every room and I'm not sure why

    I've tried heaps of different things to try and fix this but so far nothing has worked This code is in a pickup item that effects your fire rate. This is in the collision with the player event if (global.hasgun == true) { global.firedelay = global.firedelay + 0.1; } instance_destroy()...
  8. V

    I'm having a duplication bug I can not figure out.

    I am making a card game and I have the draw and use function almost complete. Right now, however, my deck never runs out of cards. you can see in the first screenshot that I am creating 6 cards in my deck but they never get deleted when used. Here is the code for it. P.S. Sorry if the format is...
  9. CK Scores

    Mac OSX Gamemaker Studio 2 v.2.3.0 cannot load projects

    Hi guys, I recently got the new update for GMS 2. However, I cannot load my projects and when I click play, the output only runs for less than a second before it stops. There are no compile errors or any other type of error to show. I've restarted the app multiple times. I'm not very...
  10. D

    SOLVED #region code folding

    Hey, I wonder if there is an option for the IDE to toggle remember/forget which #regions are folded and which ones are not, when closing and opening your project? Thanks in advance.
  11. paulog

    Legacy GM Check collision with all objects but self?

    Hello! I'm making a simple game in GM1.4 and I want to check if an object is colliding with any other object but not with itself. This is the code I'm using: if position_meeting(x,y,all) { global.free = 1 } if !position_meeting(x,y,all) { global.free = 0 } Tha variable global.free is always...
  12. J

    Enemy sprite jitter when following player (SOLVED)

    (this is a video example of my problem) The enemy object seems to jitter up and down on the yaxis when following the player from the direct left or right. here is his movement code: dir1 = sign(obj_player.x - x); dir2 = sign(obj_player.y - y); hspd = rspd * dir1; vspd = rspd * dir2; x =...
  13. Gorshalox

    GMS 2 Jump Animation

    So I'm making 2d platformer and I don't know how to make correct the animation of jump, in my case the player jump and the animation is playing very fast and ends in air, I will post the my animation code in Step Event below //Animation //===Walk if (key_right) { sprite_index =...
  14. M

    how to exit code but not the whole Event?

    For a long time I was puzzled by why an enemy object's Create event wouldn't work (it would only play actions up until a certain point). Then I realized that in a code that is played in the Create Event, when certain conditions are met, it says the 'exit' statement; I originally meant for it to...
  15. mcglubski

    GMS 2 Array for Collisions HELP! [SOLVED]

    Can someone help me simplify this into an array or something else? Even with years of experience with GMS I still struggle to understand simple arrays, especially after coming back to it since buying GMS2. I feel like this should be easy but everything I try doesn't work. If someone could...
  16. R

    SOLVED collision problem

    Hello, I am having the most frustrating time trying to understand what I am doing wrong in my code, because the collision works sometimes and sometimes it does not. for example, sometimes I get stuck in the ground right at game start. And i have noticed this only happens when I apply a...
  17. kureoni

    GMS 2 temporary buffs

    so, in my game there is a store and you can buy buffs, such as movement speed increase buff etc. right now, when you buy the buff, you gain extra movement speed, but it needs to end after some seconds, but i'm not being able to program that. so, there is an object in the store and when you...
  18. Dane Emark

    SOLVED Smooth grid movement

    Hi, I am totally new to the GameMaker forum:). NOTE: I am still using GameMaker Studio 1.4 so I don't know if Game Maker studio 2 code can work. I was making a test game to improve my programming skills. I wanted the player, the enemies, and the other objects to move on a fixed grid(32x32); here...
  19. flyinian

    SOLVED Out of curiosity, Is there a better way of doing this?

    Out of curiosity, Is there a better way of doing this? This is for a mouse hover highlight for a button. I was trying to get my navigation system for my game to not execute the button highlighting per step. This took me awhile to figure this out, a different version of this was executing...
  20. A

    SOLVED How can i change background colour (with codes)

    I want to make a rainbow effect on the background. How can I? edit:Okay guys i did it create event: global.TimeToGoUp = true global.Bgtimer = 0 step event: if(global.TimeToGoUp = true and global.Bgtimer = 500){ global.TimeToGoUp = false } else if (global.TimeToGoUp = false and...
Top