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?
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...
I currently need to know a way of selecting all of a certain object.
My previous solution was:
if(self = ob_box)
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...
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...
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.
image_speed = 0;
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?
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...
!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...
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'm trying to write to a file, using this code:
var level_data_file = file_text_open_append(working_directory + "level_data.json");
I am drawing the text...
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...
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%.
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...
editor version: 126.96.36.199
runtime version: 188.8.131.52
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...
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...
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);
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?
Hi, how are you all today?
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)?
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...