ID:267221
 
I need help making a code that moves 3 or 4 objs in a row down... thats if the mob (player) is below the objs.. I tryed all kindas of way such as going through all objs and locating the ones that where only above the mob... I know that has to be an easyer way than the way im going (the process takes about 30 secs with the way im going it) can anyone suggest something?
I'm not quite sure what you mean. Can you clarify that a bit?
In response to Crispy
ok... im trying to make a tetris game... where when you clear a row the ones above will move down and the ones below will stay... does that help a bit? (when I say above I mean every block above will move down 1 space....)
In response to Shy_guy197
Ah! Crispy understands now! :-)

Well, the most obvious method I can think of is this:

<code>var/rownum=5 //Set this to the number of the row that you want to clear //Delete row #rownum, and move blocks above it down one space for (var/obj/block/B in world) if (B.y==rownum) //Delete this row del B continue if (B.y>rownum) //Above cleared row; move down one space step(src,SOUTH)</code>

This also deletes row #<code>rownum</code>.

Hope this helps!
In response to Crispy
you didn't really help... because i'm using a diff system... BUT... your code helped me figure out what to do... so .... it really did help me alot!!!!!

all I did was
for(var/obj/Block/B in world)
if(B.y >= A.y)
step(B, SOUTH)

EASY... didn't think till you helped thanks a bunch!!
In response to Shy_guy197
That's basically the same thing, you know, just with a couple of variables switched around. :-)

Glad I could help!