code help

  1. Gonix

    SOLVED Execute function stored in Ds_queue (or any data structure)

    I'm trying to make a function queue, where I could enqueue function with ds_queue_enqueue, and in another queue are stored the de-queue condition, each frame if the condition is met, the head function is de_queued. But I cant manage to store functions in the queue, only the returned value by...
  2. Redcakes

    Pressing F4 for fullscreen

    So I made a camera and I have it working. The only thing now is I want to allow players to press F4 to switch it into fullscreen. I have this code in a persistent object: if(global.fullscreen = false){ window_set_size(displayWidth,displayHeight); } ...which sets the camera to the settings I...
  3. S

    sprite gets stuck in wall

    hey guys, while i was trying to figure out my jump sprite i decided to try and copy paste someones code, it helped with the jump sprite, but when when the character spawns, it falls down and lands in the middle of the wall and i cannot jump or move. i took out tiny areas of code and this is the...
  4. T

    Need Help with Alternate View using Mouse Input

    So Im working on a game where I have a little view that comes up in the corner to watch my character when I leave as another character in the game. But I want the view to disappear when my mouse goes over it, because it puts my mouse in that point in the room when it goes over the view, I tried...
  5. G

    GML Pixelated Text

    I am having a problem with the text coming out weird and pixelated. I dont know what to do to fix it. I have read some stuff on scaling but I dont know how to do that. If you dont know what I am talking about here is a picture It looks wrong to me
  6. N

    Skip when moving

    Hi im following this tutorial on youtube, but when my character drops to the ground. it skips along the floor. and some times it get stuck in the wall. and when i hit a wall i skip again. anyone have a solution?
  7. L


    im trying to toggle a button like if i were to be changing items and keeping it on so if i press the 1 key the item will stay on until i press 1 again My Code: //Toggle I/O Key 1 if keyboard_check_pressed(ord(1)) { if Toggle_Trigger1 == true { Toggle_Trigger1 = false; }...
  8. S

    GMS 2 Wrong switch statement

    Ok i have problem with this. My switch statement make fatal error at line 20 and in line 29 i think same issue.Please little help with this. //variables kspace = keyboard_check ( vk_space ) ; attackspeed = 3 ; dire = 0 ; //code for attack move enum dir { maxx, minn, }...
  9. S

    GMS 2 [SOLVED] // Object stick to another and move together like 1 object even with rotation.

    Ok now is everything work good and i update this code. Now you can just copy the Code. // Variables image_angle = obj_player_player1.image_angle ; // Copying image_angle of another object in this case image angle of object1 is apply to image_angle object2 object_to_stick =...
  10. S

    GMS 2 Set timing action without Timelines. Code dont work Pls HELP..

    Hi everyone, i have problem with some part of code. Shortly say. I want set time action [or duration [cooldowns] of abilities and spells] when i dont want use Timelines , but i have a problem with this. Here i try set the shifting mode not like a sprint but like a shifting fast move to direction...
  11. Bomb The Moon

    [solved] is\won't be logic help (fade in\out)

    I have created an objected that draws a shape on the screen while the player is colliding with it. I have coded it so the that shape fades in, after the collision with the player object, and that's working great. However, I am trying to come up with a way to fade the drawn shape away, when i...
  12. S

    Code Randomly Stopped Working

    Hello all. I'm verry new to this here program and would like some help. I followed a youtube tuturial on how to make a horizontal collision to learn the basics of coding. The code worked great except for some minor problems. Suddenly one day the code stoped working out of the blue. The vertical...
  13. Z

    Legacy GM Problem with simple High Score

    Hi, I have problem with simple HighScore tab .I tried YouTube tutorials.I tried to figure It out and It didn’t get well.Please if you know simple code of HighScore Tab that will save and show saves of players with scores every time the game ends.Player can write score and if score is too low...
  14. B

    asset_get_index + file_text_read = problems

    I got GM couple weeks ago and decided to make a simple text game to test it out. Haven't touched code in years so I'm rusty. Well anyway, I wanted to store the text and sprite names and so on in a text file. Not even 10 lines of code I stumbled into a wall. When I get the sprite name with...
  15. B

    GML Help with right-stick in twin-stick shooter

    Hi everybody, I'm having a bit of trouble with the behaviour of my right stick, which aims in my twin-stick shooter. It work great with keyboard & mouse, where the mouse points the direction to shoot. But I've been starting to implement gamepad controls instead and so far everything works except...
  16. F

    Windows shooting

    im making a platformer game and i need to add shooting can anyone help me with a code.
  17. TypoTigress

    Legacy GM So, like a idiot, I decided I want to program water...[SOLVED]

    EDITED: to those wanting to know the solution, check below. Hi there! I'm still quite new to game making even though I bought GM:S like a year and a half ago, but have elected to go with GML as much as I can and have been learning under the Shaun Spalding tutorials over on YT. Recently I...
  18. W

    GML Highlight button [Sloved]

    I have buttons that highlight when u r on them. But they are not highlighting right. Idk why can some one help? This is ob_store_menu if (keyboard_check_pressed(vk_up)) { if ( = 3) { = 0; } else if ( >= 0) { += 1; } }...
  19. W

    Legacy GM Enemy animation in four directions

    I am trying to make my enemy animate in all four directions. But it only goes left and right. I know its because of the right and left code on the bottom but I cant think of how to make it animate in all four directions Here's my code: if (x != xprevious || y != yprevious) { image_speed =...
  20. W

    Windows Creating a txt file to the desktop of your computer

    I have been thinking of a game where the game creates a file on your computer but I have no clue how to set it up. I know the code to create a txt with a ds_map and file_text_open. But dont know how to make it go to the desktop of a computer. Here is the code for the creating txt file: help =...