I want this to happen when i press any of the w,a,s,d buttns:
the platform (rectangle) starts going in the specified direction until it reaches the end of the bored/it reaches another platform and then it stops.
what happens in my game .... it freezes ... and does not react to any thing. i am forced to use the task manager to stop it !
here is what i did on the w key(i did the same for all the other key with minor changes and non of them worked):
if you have any question about my code i will gladly help you help me.if(keyCode == e.VK_W){ if((y1-CP != y2 && x1 != x2)||(y1-CP != y3 && x1 != x3)|(y1-CP != y4 && x1 != x4)|(y1-CP != y5 && x1 != x5) |(y1-CP != y6 && x1 != x6)|(y1-CP != y7 && x1 != x7)|(y1-CP != y8 && x1 != x8)|(y1-CP != y9 && x1 != x9) |(y1-CP != y10 && x1 != x10)|(y1-CP != y11 && x1 != x11)|(y1-CP != y12 && x1 != x12) || (y1-CP >= 205)){ while((y1-CP != y2 && x1 != x2)||(y1-CP != y3 && x1 != x3)|(y1-CP != y4 && x1 != x4)|(y1-CP != y5 && x1 != x5) |(y1-CP != y6 && x1 != x6)|(y1-CP != y7 && x1 != x7)|(y1-CP != y8 && x1 != x8)|(y1-CP != y9 && x1 != x9) |(y1-CP != y10 && x1 != x10)|(y1-CP != y11 && x1 != x11)|(y1-CP != y12 && x1 != x12) || (y1-CP >= 205)){ y1-=CP; } if(x1==655 && y1==505){ //winner } } else{ //print message! } }