-
1 Attachment(s)
Viking Game
I have partly made the enclosed VB game, but I have run into a problem! I need the squares to not move more than one square outside its current posistion, and not to overlap on its own player. Please can someone edit the code and post it here, because I can't get it to work! Thanks,
James:D :D :D :D :D
-
Huh try keeping the coordinates of the selected piece in variables (for example, SelX and SelY). Then you can check if the selected piece is 1 square up, down, to the right or to the left of the new tile :)
Here's some pseudo-code:
Code:
if we're selecting a piece then
selx=selected piece x
sely=selected piece y
else
if selx-1=selected piece x and sely=selected piece y then
'Note that this only checks if it's to the left (selx-1, sely)... you'll have to test all the 4 directions to make it work :)
this move is valid so move it :)
end if
end if