I’m going to create my own chess game… can someone help me with some actionscript? If you give me the code for like one piece I’ll try to customize it to the other pieces.
I think it’s a bit of a hefty project to take on if you’re not too hot on actionscript, to be honest. maybe you should start with something simpler.
like lego said it is a big project for someone new to actionscript.
Off the top of my head I would say you make an array with placeholders for each square on the board.
You make a move and check if the move for that piece is legit, then tell that square that it’s occupied (with the array).
Obviously different peices would have different legitimate moves, and this is where you would just get into thick actionscript. Buy some books about flash game development.
I would make 8 arrays of 8 squares each then you can reference them like a matrix using nested for loops. It would be a big big pain though…maybe make checkers?
Yeah I guess I’ll study actionscript before I do this… pretty much the best I can do is make the board with AS.
you know how long it took to program deep blue (the 'pootah who beat kasparov)-
the trouble with chess is that you use strategy - you have to think way too many turns ahead. Computers need to be thoroughly programmed to human’s logic (which is sometimes impossible)… It’s not simple action-reaction programming.
so i’d say - keep off chess- try tic-tac-toe first =)
he can try making 2 player chess which doesn’t require AI which would really reduce the amount of as needed…
i think what mlk said would be a good starter though… tic tac toe would atcually be good to start with because he will have to learn to code based upon positions of things on the board, except in this case it will be a smaller board with less options… but still a good starter project… and to add computer AI would be good a/s practice… i know someone in a class where they had to make a tic tac toe game, took a few pages of code in visual basic to get it working (although i never actually tested it) but they say it worked well… so yeah, good coding practice
[edit]
oops didnt see there was another thread started for it sorry
[/edit]
*Originally posted by zylum *
**he can try making 2 player chess which doesn’t require AI which would really reduce the amount of as needed… **
There is still a certain amount of AI involved in order to determine the legal moves for each piece at each movement. The best way would be to use binary trees…
*Originally posted by Jubba *
**The best way would be to use binary trees… **
Can those be implemented in Flash?
I’m sure there’s a way… but I’m sure its not easy…
There must be a way, but i think implementing a bitboard in Flash wouldn’t be a better idea than merely using arrays… think of the conversions and all
true. I’m still interested in attempting this but I have absolutely zero time… we’ll think of something…
Couldnt be bothered to look it up porperly cos i’m sure one of the Special K’s already know. But can you make a 2D array in Flash? I did a very quick search and found nothing on it. Its a real shame if you cant, cos a 2D array would of been brilliant to use, I’m creating a game (Battleships) in Java using a 2D array to identify the squares on the boards.
Viru.
P.S Just in case your not sure of what a 2D array is in Java it takes the following form:
int anArray[][]; // Note the two sets of [].
yes you can make multidimensional arrays in flash.
Ok, sweet, think i might make a battle ship game in flash, animations would be sooo much easier . Gonna go look up how to do it now, but can you tell me anyway since my quick search before yielded no results.
Thanks,
Viru.
Ah, thanks, no wonder i was using keywords ‘2D array flash mx’.
Thanks again.
Viru.