if keyboard_check_pressed(ord(myLetter)) {
global.score_1++;
io_clear();
instance_destroy();
}
The io_clear() will prevent other keyboard_check_pressed() calls from detecting it.This code could go inside the lettered objects themselves (myLetter would be the letter the player needs to press to destroy it). However, this will destroy a seemingly random object. If you want a specific object, you either need to fetch the ID of it or set up your game so the object that should be destroyed first gets handled first.
Method 1) Handle the desired object first by altering its depth
By default, I think the first instance created (the oldest) is the processed first. You can test this yourself with the code I posted at the start. However, that's not always the case (I did some tests one time and the results took the newest instance). An alternate means of making sure the desired object is handled first is to have your objects update their depth and then put the code I shared in the Draw event instead of the Step event.
If the blocks are falling from the top of the screen, then you can set in the step event
If they are coming from off the right side of the screen, you can set in the step event
Note that this is a little different than normal depth-setting code you'll see floating around, which is -y. In that code, you want the objects toward the bottom of the screen to draw last so they are on top. With the method I described, though, the objects toward the bottom will draw first, so they are below overlapping objects. So in some cases, this might not be a desirable trade-off (shouldn't be a problem for left-right scrolling, though).
Another method of altering the depth is to have a global variable counting down every time an instance is created and set depth based on that.
Code:
depth = global.depth_change--;
So the first instance would be created at depth 0, then the next would be created at -1, then -2, and so on.