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...
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...
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...
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...
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
global.orangelocked = 0;
if (device_mouse_check_button(0, mb_left) && global.coincount >=...
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: 220.127.116.11
runtime version: 18.104.22.168
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...