ID:267221
![]() Jan 15 2003, 3:34 pm
|
|
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?
|
![]() Jan 15 2003, 5:09 pm
|
|
I'm not quite sure what you mean. Can you clarify that a bit?
|
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....)
|
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! |
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!! |