solved

  1. Bentley

    This code works, but why? draw_set_alpha at the end

    Hello. Just a heads up, I'm a beginner. I made a room transition object that draws a rectangle over the screen. It fades in in room 1, and then fades out in room 2. Here's the code. (I'm sorry for the lack of indentation. After I posted, the indentation was removed). draw_set_alpha( alpha )...
  2. Bentley

    draw_sprite( spr_gun, -1 ) not animating

    Hello. Just to give you a heads up, I'm a bit of a beginner. For some reason, the following code won't animate the sprite: draw_sprite( spr_gun, -1, x, y ); It works in other objects, just not in the object I want. Some additional info: -The object I want the code in has its own sprite...
  3. T

    Legacy GM Particles and Memory Leaks

    I've been facing this issue for a long time in my game and it's about time I asked for some help. It's a bullet hell game that has A LOT of particles in it since I like the effect of lasting debris when an enemy is destroyed. I'm pushing the limits of how much particles I can have around...
  4. J

    Legacy GM [Solved] Some code crashes with YYC, other code isn't run at all...

    So I tried to compile my game with the YYC today and once I got it working (i.e. the game actually running), to my dismay, certain parts of my game were just acting weird, some tweening wasn't running and my pause menu crashed the game. Here is the error on the crash: FATAL ERROR in action...
  5. L

    Legacy GM random background color[SOLVED]

    hi all just wanting some help with random background color at start of a room heres what i was trying with little luck //in create event of object in room global.cola=make_colour_rgb(100,145,125); global.colb=make_colour_rgb(100,125,225); global.colc=make_colour_rgb(200,115,115)...
  6. K

    Any non-obvious issues using decimals for HP, etc?

    Hi all, I am setting up some of the basic variables for a game, and am trying to decide if I allow non-integer values for things like player HP, Hunger, etc. The issue is with things that give bonuses, etc. Let say a weapon has a standard damage of 2, and I want a player skill to give a 10%...
  7. A

    [Solved] How do I Make a projectile fire from a specific point on an object that can rotate?

    I lurked a bit on these forums and on the steam forums and have been unable to find a working solution for my case despite may other similar systems. Put simply, I have an object that the player con rotate. Said object is only supposed to fire projectiles from a specific point. {(18,-8) The...
  8. F

    Isometric Depth Code, Depth = -y, !Working

    Hi, I'm working on the May Jam and I'm having a problem. I am using depth = -y in the Step Event of every object. When I run the game, and move the player lower than the enemy (giving him a higher Y and therefore a lower depth), he should show in front of that enemy but he doesn't. It's not an...
  9. G

    [SOLVED] Health Bar Visible Only Some of the Time

    Hey, guys, What I'm trying to get done in the game I'm working on is having a set of health bars that are only visible when you click a button. The health bars don't actually represent health, though. They represent the number of enemies in the room, so the level ends when there are too many...
  10. Noah Copeland

    Legacy GM [SOLVED] Find the nearest object to the left/right

    Hello! I'm trying to figure out a way to find the nearest enemy (obj_enemy), but only in the direction you are facing. (This is a 2D sidescroller for context). If you are facing right, all the enemies to the left of you may as well not exist. The code only needs to find the nearest instance...
  11. D

    GMS 2 Draw event not refreshing

    I'm not sure if i learned bad habbits from GMS1 but Im working on a small app currently using normal draw_text_colour(x,y,string,col,col,col,col,alpha) code and everytime the draw event is run, the new text is drawing over the previous state of the text and not clearing the previous text like I...
  12. L

    Legacy GM diagonal moving like flyup

    trying to achieve diagonal movement left right with mouse left. Hi all i am trying to do diagonal movement with mouse left button like in the android game called fly up but am not succeeding so i ask for the wisdom of the GMC for help. Thanks guys heres what i tried //in create event...
  13. Phsyrik

    Legacy GM [SOLVED]Value not staying?

    So I have a store in my game, and when I buy something, and come back to the store its locked again. I need to make it stay unlocked CREATE global.orangelocked = 0; STEP if (device_mouse_check_button(0, mb_left) && global.coincount >=...
  14. cdgamedev

    GMS 2 [SOLVED] Issue with lengthdir_y

    Hello, I'm trying to use lengthdir_y but when I enter Speed = 16; direction = 45; vspeed = lengthdir_y(Speed, direction); it returns 0. However, when I enter Speed = 16; direction = 45; vspeed = lengthdir_y(16, 45); it returns -11.31 as expected. Am I missing something or is it broken? This...
  15. R

    Legacy GM Get a block to move so many points and stop [Solved]

    Trying to make a block that you can push. It moves a set number of points (16 points) and then stops, until you push it again. tried using the move_towards_point function but because the point I want it to move to is variable, it doesn't stop moving when it reaches the point. I've included my...
  16. A

    Legacy GM Selecting all of a certain object [solved]

    I currently need to know a way of selecting all of a certain object. My previous solution was: with all { if(self = ob_box) { //actions } } but i'm now pretty certain that that doesn't work at all and is the cause of many bugs. Is there a way of...
  17. Chris Smith

    Legacy GM Making Groups of Objects Recognize Each Other & React To Changes

    What I am trying to do is use groups of the same object, for clarity I call the object obj_alphablock, to create a similar effect to what you see in newer mario sidescrollers, where you walk through a part of the wall and the wall goes transparent. Essentially I want a collision between the...
  18. N

    Windows Top Down Shooter Controls.

    I am trying to make a 360 degree top down movement but there is a problem with it. When I test it, the player by default moves right and does that when I release the arrow keys and pressing down + right makes it stuck. I dunno what the problem is. Create: image_speed = 0; Step: ///Movement var...
  19. T

    Fastest way to clear a surface? SOLVED

    I'll make it quick, I need to clear a surface, i.e., take every pixel in it and replace its r,g,b,a by 0,0,0,0, as if it had been just created. What's the easiest way to do so, short of freeing the surface and creating another?
  20. T

    Shaders Shader: passing only one color SOLVED

    Hello, I'm trying to do a shader that passes exactly one color, comparing the color to a list before drawing every pixel. If the color matches a parameter, it should draw a listed color, and if the color does not, it will draw a pixel with zero alpha. How could I go about this? I tried using...
Top