If you just need to measure if they went off the top of the screen, its simple. Give the enemy actor a behavior:
if(y of self < (0 - height of self)) {
enemies killed = enemies killed + 1;
kill self;
}
If the "enemies killed" counter isn't a game attribute, you'll need to use the appropriate block to message the correct behavior. If your scene is larger than your camera and you just want to know when they go off-screen (not off-scene), instead of zero, use "y of camera".
EDIT: Make sure your enemies have used the block "make self always active" so they continue to process when off-screen.
I used your code:
But I get all of this:
Behavior: Design_1_1_EnemyMotion at line 41
Syntax error: expecting rightparen before of.
if(y of self < (0 - height of self)) {
Behavior: Design_1_1_EnemyMotion at line 41
Syntax error: expecting identifier before rightparen.
if(y of self < (0 - height of self)) {
Behavior: Design_1_1_EnemyMotion at line 41
Attribute is invalid.
if(y of self < (0 - height of self)) {
Behavior: Design_1_1_EnemyMotion at line 42
Syntax error: expected a definition keyword (such as function) after attribute Enemies, not Killed.
Enemies Killed = Enemies Killed + 1;
Behavior: Design_1_1_EnemyMotion at line 42
Syntax error: expecting rightbrace before semicolon.
Enemies Killed = Enemies Killed + 1;
I've tried all the obvious stuff (doing exactly what it tells me to do) but it just keeps on giving me more and more errors.. Help the nub please!