code

  1. Osoy

    Question - IDE Code Formatting

    Hi, I have searched through keybindings looking for a key combination that would auto format code similar to CTRL+K + CTRL+D in Visual Studio. Is there such an option and if not is it on the road map for a future enhancement? Thanks.
  2. MoriMori

    Beginner help needed rock,paper,scissors

    sprite_index = choose( spr_card_paper,spr_card_rock, spr_card_scissors); This was made in the create event with obj_cards, which is a parent to the objects; obj_paper, obj_rock, obj_scissors Now if you've played rock, paper, scissors then you understand how the game works, now I need help on...
  3. G

    GMS 2.3+ For-loop efficiency

    Dear community, I want to draw a string with 2, 3 or 4 different elements after each other. The elements are in a ds_grid called ds_AllAgents. I now have this super inefficient bit of code and am wondering what are good ways to make it (way) more efficient. Thanks in advance for your help...
  4. itarkytec

    Windows Need help making a string

    Hola comunidad, estoy necesitando un poco de ayuda, agradecería que las respuestas a este post estén preferiblemente en español, aunque si es de ayuda no me molestaría en recibirla de todas maneras. Contexto: estoy intentando hacer un cuadro de texto que solo acepte números como entrada...
  5. face

    GML Programming basics in 20 minutes. (cheat sheet)

    GM Version: Studio 2.3 Target Platform: Windows Download: see code below Links: n/a Summary: In this tread I will teach you the basics of programing with GML. Attention: Useful information will be available here but you will need to use this regularly to get decent at it. What not to expect...
  6. sweep

    GML sprite issues

    Hope you can help,it's probably an easy fix but I can't find a solution. My player isn't switching to the correct sprite when I am climbing. The code is below. The player changes to its falling sprite while going up or down a ladder. Is the jumping and falling code overwriting the climbing ...
  7. konkrz

    Windows Code sometimes works, sometimes doesn't

    Has anyone else encountered issues with code sometimes working and sometimes not? Personally I have seen it with instance_place_list and with for loops. I think it only happens in instant events (Create, Destroy etc) not in step/draw. Thinking more about it, i think it is about variables...
  8. D

    Galaga style enemy behavior??

    trying to make a galaga style shooter game, but have been stuck on enemy behavior. I have tried many different ideas for it but always end up with an issue that I can't find a way around. I have a non-visible object that acts as the creator of the enemy instances off screen at the top and use an...
  9. phillipPbor

    GMS 2.3+ screen problem.

    i happend to stumble upon a problem that i cant fix, recently i was making 2D tarraria with game maker studio 2 but while making a game, i found out the problem is that off-screen is black. after following the tutorial of minecraft part 3 here following tutorials from the other user here i...
  10. flyinian

    SOLVED What would cause a sprite to animate at room speed(or really fast) when its coded to draw in the draw event?

    Newest: So, I just tested the code in another object's draw code and still had it animating really fast. I then added the "image_speed" in the create event and set it to 0.1 . This slowed it down and it appears to animate at desired speed. Could someone explain this to me? As well as, how to...
  11. G

    I am getting a programming error message: Variable <unknown_object>.y(1, -2147483648) not set before reading it.

    So, i follow a tutorial and i made the script as i saw from the tutorial but i got this message ___________________________________________ ############################################################################################ ERROR in action number 1 of Create Event for object...
  12. flykidsblue1

    Idea Is GITHUB a viable way of storing files for my games?

    Hey everyone! So I basically want to add a "news" section in my game where users can be informed of any upcoming updates to my game/games and what not. I was using the http_get_file(); funtion to download the "news.zip" file. I was first thinking of using google drive, but each time I delete the...
  13. C

    Hot bar Spell cooldowns

    I'm currently working on a hot bar for spells in my game, and I got something working but I think its just way to much unnecessary code. I was hopefully one of you Game maker wizards could help me. anyways code: I only provided the code I'm using for the spell cooldown. here are 4...
  14. Daniel Mallett

    Sanity check

    I spend a lot of time coding alone. I always feel as though I am in an echo chamber. Is there anyone (Preferably someone with more experience than me) that would be willing to take a look at a sample of my code just to offer some advice. Just to check I haven't got any bad habits or doing...
  15. 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...
  16. 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...
  17. 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 =...
  18. 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.
  19. 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...
  20. 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...
Top