1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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?
  7. 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...
  8. C

    GML [SOLVED] Moving platform collisions

    !SOLVED! Thanks everyone for your help Solution below for reference Thankyou everyone, I got everything working, including staying grounded and sticking. I'm really happy with the result. I set an actor parent object so all my other characters can benefit from the collisions. I stuck with...
  9. T

    GMS 2 [Solved] Camera zooming focussing on 2 objects.. An attempt was made.

    Edit: This is solved. There was a mistake in my code I didn't see until I took a break. I can't seem to delete the thread. Sorry. Good afternoon, everybody :D I have a single-screen 2 player game, with a play area of 9600 x 5400 where two people flying around planes and shoot at each other. I...
  10. csanyk


    I'm trying to write to a file, using this code: var level_data_file = file_text_open_append(working_directory + "level_data.json"); file_text_write_string(level_data_file, level_data_string); file_text_writeln(level_data_file); file_text_close(level_data_file); I am drawing the text...
  11. R

    Legacy GM Problems with if statements

    I have a set of if statements that are not executing like it should. The player name starts as an array of 9 characters due to an algorithm that will do something based on math done on the asni char values of the characters. The array is then put into a test string and checked. The set of code...
  12. Online Handle

    Windows [SOLVED] CPU hovering around 90% when using GS2

    This has been a problem since I purchased the software a few months ago. I figure I'd give it time, hoping that an update would fix the issue. Still nothing, so I'd figure I'd post a thread here about it. When GS2 is the primary selected window, it ramps up its CPU usage to around 90%. When...
  13. G

    [SOLVED] Image_index won't change because of draw event

    Hey, guys, I've tried various solutions and searched the web. It seems like the solution must be pretty simple, but now I'm ready to turn to the forum. As the title states, the image_index will change at a mouse click, but when I add the draw event, the image_index won't change. Here is code and...
  14. MudbuG

    Windows [SOLVED] Sprite is non-existent, object not visible

    editor version: runtime version: added a sprite by dragging an image into the IDE. Created an object assigned sprite to object drag object room run -- object not visible. Next, I added draw event with draw_self(); I get the following exception...
  15. A

    Legacy GM [SOLVED]tile_get_ids() Issues with instance_position objects that are drawn with tiles.

    Greetings! Thank you for taking the time to look at my post. First time posting as I have been struggling with the same issue for the past 3 days now. My project level is randomly generated and I'm currently adding colliders on to tiles to prevent my player object from leaving the...
  16. T

    Problem passing shader uniform

    I'm having a problem passing a shader uniform. Here's my fragment shader. // // Replaces brightness with a varying amount of green. // varying vec2 v_vTexcoord; varying vec4 v_vColour; const vec4 weight = vec4(0.2125,0.7154,0.0721,0); const float positive = float(0.5); void main() {...
  17. T

    Shaders Where to begin with shaders?

    Hello, I'm gonna try something simple for starters, writing a shader that turns the whole sprite black, and another that turns the whole sprite white. However, I don't even know where to begin. Where can I learn how to use shaders?
  18. K

    GML [SOLVED] Passing id of creator object to created object

    Hi, how are you all today? tl;dr version: Is there a way to let a created object know which instance created it, so i can keep it aligned with its creator's x,y, (to do the x,y, matching in the created object's code rather than doing this alignment in the creating object's code)? Long version...
  19. mather12

    GMS 2 [SOLVED]My sprite image would be twist with the change of the view position

    I don't know what's the reason,the sprite image would be twist with the change of the view position.
  20. Brenden

    Legacy GM Object depth drawing[Solved]

    I have a game where objects are in a room and have no draw code but are visible with a depth of -1. Now I have a separate object that basically controls my whole game. That object is drawling a HUD and some other stuff at the set depth of the object at -20. So all the drawings are higher up then...