Problem Questions included (The one who solves my problem get paid via paypal.com) also, it’s not that I cannot get the code working, it’s that the code is TOO long (like 5000~10000 lines in total) and I want to shorten it to like 500~1000 lines to make it more understandable for the guide i`ll release to the unity community : http://pastie.org/768904
if u like pasteit4me then : http://www.pasteit4me.com/95023
pastie.org codes can be editable so I provided 2 links…
Ever used a for-loop, or nested for-loops? You’re manually duplicating your code to execute it multiple times (with different arguments). Without looking at your code in detail, I would bet that you could use nested loops to bring this mess back to 40 lines max.
Also, you declare the direction variables in each function, but they’re always the same. Declare them once, outside of these functions.
… Are you sure you’re up to the task of coding this game? I’d say you could use a bit more practice on some simpler games. Start small, and then work your way up. Good luck.
The “problem” seems to be the if statment that get huge after a while, maybe split it up and then use a clever way to put it togheter in there, somehow…
OBS Pseudo code!!!
function aName(num, steps, int oldX, int oldY, int newX, int newY){
dir = new Array(1,2,3,4,5,6,7)
var value = newArray;
value[0] = board[oldX + dir[num],oldY + dir[num]];
for(i=1;i<steps i++){
value = board[oldX + dir[num],oldY + dir[num]]; } if(board[newX,newY] == null){ if(newY == oldY + dir[num] (newX == oldX + dir[num]) board[oldX,oldY].name == “White Checker(Clone)”){ // The huge IF statment make my brain burn, but if u pick em out and put em under each other u see a pattern. The pattern i think is the answer to the riddle. } } }