solved

  1. Bentley

    SOLVED: Why doesn't this code prevent reverse direction?

    I'm trying to make it so the player can't go backwards. Ex: if he's moving east, he can't go west. switch (keyboard_key) { case vk_right: target_dir = 0; break; case vk_left: target_dir = 180; break; case vk_up: target_dir = 90; break; case vk_down: target_dir = 270; break; }...
  2. Bentley

    SOLVED: Why do I create two bomb instances?

    Hello, 1 bomb is supposed to be created when space is pressed. For some reason, two bombs are created. I know this is a rookie problem. I've looked for the source of the bug and I can't find it. The game is a bomberman clone (a terrible one). The movement is grid based. Because a bomb can be...
  3. H

    set an instance's sprite at random

    Hi, When my 'human' instance is created i want it to choose, at random, from 3 different human Idle animation. right now, in the create event of the instance, it executes: sprite_index = choose(m1Idle, m2Idle,m3Idle); //(m1Idle,M2Idle.... are the names of my sprites) but when the game...
  4. captiongoosebut

    Legacy GM How to temporarily pause alarm?

    Basically I have enemies spawning randomly using an alarm. Every 100 points you get the game gets a slight increase in difficulty. At 500 points a boss spawns and you have to kill the boss, but after that nothing else spawns. I think this is because setting it to -1 actually turns off the alarm...
  5. Becon

    Legacy GM [SOLVED] Endless Runner with Slopes help

    So I requested help on this old project back in the original GM forum and no help but I have come back to it trying new things. Off and on for a few years I have been trying to make a random generated endless runner using slopes. I can get the slopes to work fine on their own in many different...
  6. A

    [SOLVED]Draw an arrow without using draw_arrow function...

    Hello everyone, I'd love to draw a triangle at the end of the drawn line (code below) so it follows mouse position (as the oLine does) without changing its size and shape(see picture). I cant use draw_arrow or draw_sprite function because it doesnt fit my needs. Object oControl: Mouse Event...
  7. P

    Legacy GM lock on target

    I want the object to shoot the enemy until it gets out of range or collision condition is true then try to choose a new target. I have defined "var enemy=obj_enemy" in create event the code below is in step event. it doesn't make any error but the object just does nothing please correct it if...
  8. A

    [SOLVED]Draw dotted or dashed line?

    Hi all, I made this simple code for drawing normal lines. Now I want to change it into drawing dashed or dotted lines. How can I modify this to make it draw dotted or dashed lines? Create Event: locked = false // so I can draw more than one Line last_x = mouse_x last_y = mouse_y Mouse Event...
  9. Bentley

    SOLVED: Minesweeper Clone Attempt. Getting all the 0 tiles to flip

    I've been trying to remake Minesweeper and I've come across a problem. When you click on a 0 tile (a tile not touching any bombs) you can sometimes turn over a large piece of the board. In trying to replicate that, I thought to check in 8 directions from where the player clicked. I soon...
  10. Bentley

    for loop and instance_exists question

    I was just wondering the following: if I put: place_meeting(x + i, y, obj_wall) as the expression in my for loop, is it then unnecessary to check if that wall exists? For example, let's say I want to blow up every wall to my right: Is this OK? for (var i = 1; place_meeting(x + (i * 32), y...
  11. Bentley

    Rotate image_angle but keep instance/sprite mask aligned to grid?

    Hello. I have an object that is 32x32. Its collision mask is set to "full image". In the object's step event I coded: image_angle += 1; //Spin The problem with that line of code is that when the instance spins, it no longer lines up with the grid. I assume that the rotation causes part of the...
  12. A

    Legacy GM [SOLVED]How to draw a (curved) line with mouse?

    Hi everyone, I'm trying to figure out how to draw a line using your mouse leaving no gaps between points? I have 2 objects oControl and oPoint. And I use only this simple code: oControl_Step_event: if mouse_check_button(mb_left) { instance_create(mouse_x,mouse_y,oPoint) } If I move mouse...
  13. Skull_k

    GMS 2 [SOLVED] - Sprite flickering when zoom out

    Hello, In my project, i have a gun turrel throwing fireball. But when i zoom out, these fireball seems "flicker" or "sparkle". My fireball have only one sprite. I made a gif in order to be more clear : Another gif when i have no zoom. - My laptop have a resolution of 1366x768 (16/9)...
  14. Bentley

    A better way to get a random letter over choose("A" through "E")

    Hello. I want to make a typing game and I have a quick question. 1. I'm going to use random letters to make a string. These are my first thoughts on how to do it: letter_total = 10; for (var i = 0; i < letter_total; i += 1) { letter[i] = choose("A", "B", "C"); // ...all the way to "E" }...
  15. D

    Windows [SOLVED] Fullscreen scaling

    Hi! I've been doing some research but couldn't find anything that didn't involve me having to remake the game, if you know of any such resource please point me in that direction! So the problem is that I have a 640x640 game I want to upscale to fullscreen. I want the space outside of the room...
  16. Bentley

    event_perform destroys calling instance

    Edit: SOLVED Hello. I have a weird problem. The player shoots a laser at asteroids. I check a collision line against obj_asteroid_parent (which has 3 children: big, med, and small). The thought being that by checking from the parent, each child in the room would check for a collision. If true...
  17. A

    Legacy GM Make object orbiting around a point...[SOLVED]

    Hello everyone, I'm trying to code Throw Knife game like this one for example (https://play.google.com/store/apps/details?id=com.yxy.game.throwingknife). I found here great code for orbiting, which actually works. Instances of object oKnife are orbiting around a center of oTarget. But I have a...
  18. Bentley

    A better platform jump

    I know "better" is vague, sorry. I want a jump that is more "game-like" (that's extremely vague too). For the longest time I've been terrible at jump codes. Is there anything in the code below I can improve on? Is there another way I can go about it? Edit: I know the rising/falling variables...
  19. Bentley

    draw_rectangle to border text doesn't fit tightly around

    Hello, I can't get a rectangle to pixel perfect border text. draw_set_valign(fa_center); draw_set_halign(fa_middle); draw_set_font(fntMenu); draw_text(x, y, text); var x1, x2, y1, y2; x1 = x - (string_width(text)/2); x2 = x + (string_width(text)/2); y1 = y - (string_height(text)/2); y2 = y +...
  20. Bentley

    Jittering movement

    Edit: solved.
Top