0 Members and 2 Guests are viewing this topic.
it needs one more attribute: Alive or dead. Way easier than having a dynamically resizing list, and you just check that first before moving.
Ok I made your graphics routine slightly shorter, but your data needs to be restructured.Code: [Select]data structure:-sprites:[hexWPAWN]->Pic1PCS[hexWBISHOP][hexWKNIGHT][hexWROOK][hexWQUEEN][hexWKING][continue here for the 6 black pieces]-------how the pieces are stored in L1:{taken?(0 if still on the board),xpos,ypos,pieceno(0=pawn,1=bishop, just like the sprite arrangement, and no need for B/W pieces)}-----Now the big thing: drawing the stuff.For(A,0,31) if {A*4+L1}=!0 A>15->B pt-on(A*4+L1+1,A*4+L1+2,8*{A*4+L1+3}+Pic1PCS+48*B) ;; the x and y positions might be a bit off. you should change this later on. endendI think that will do it
data structure:-sprites:[hexWPAWN]->Pic1PCS[hexWBISHOP][hexWKNIGHT][hexWROOK][hexWQUEEN][hexWKING][continue here for the 6 black pieces]-------how the pieces are stored in L1:{taken?(0 if still on the board),xpos,ypos,pieceno(0=pawn,1=bishop, just like the sprite arrangement, and no need for B/W pieces)}-----Now the big thing: drawing the stuff.For(A,0,31) if {A*4+L1}=!0 A>15->B pt-on(A*4+L1+1,A*4+L1+2,8*{A*4+L1+3}+Pic1PCS+48*B) ;; the x and y positions might be a bit off. you should change this later on. endend
pt-on(A*4+L1+1,A*4+L1+2,8*{A*4+L1+3}+Pic1PCS+48*B)
erw, you are right T.T thanks for pointing that out. (I haven't programmed in a loooong time)I made a huge mistake: the pt-on command should be this:pt-on({A*4+L1+1},{A*4+L1+2},8*{A*4+L1+3}+Pic1PCS+(48*B))Sorry o*.*o