I am a newbie who don’t know a thing about scripting… However I want to create a simple board game with no AI. It will be as simple as the player will click on the empty area to make a black seed appear, on the next click it will turns white, then on the next click it will turn empty.
Original board:
+++++
+++++
+++++
+++++
Click once:
+++++
+++++
++B++
+++++
Click again:
+++++
+++++
++W++
+++++
Click again:
+++++
+++++
+++++
+++++
Click click click click…
+++++
++BB+
+BBB+
++B++
Click click …
+++++
++BW+
+BWB+
++B++
Click …
+++++
++BW+
+B+B+
++B++
i hope you can understand from the draft above… Thats mean the game does not need to process all the rules in the game, but the player will play the game with the rules he knows.
all of your +'s would be movieclips. in these movieclips you have 3 frames. +, B and W. The images or whatever is used for +, B and W will all go in their own frame on a single layer (+ on frame 1, B on frame 2 and W on frame 3). Under that layer make a new layer for a button. This button will control the progression of the space through the +, B and W when clicked. This single layer will cover the entire 3 frames and have just that single button. This button should be a square the size of a single playing space. I see you having two options for this button. 1) make it a normal button so that it actually is the the background of the board or 2) make it an invisible button so it doesnt interfere with any of the imagery of the board. To do that, simply edit your button and move the square shape that makes up the button to be only included in the HIT frame.
Now going back to the 3 frame movieclip, put a stop() command on every frame. You can do this in the +,B,W layer since the frames are already broken up there. Then on your button (which takes up the 3 frames) add
on(press){
play()
}
then whenever you hit the button, you’ll play to the next frame and stop. You could have used nextframe() but then at the last frame you would have had to set up something to go back to frame 1. play automatically does this so i figured it was easier this way.
Thats pretty much it. Now you can arrang your board the way you want to using these peices, test it, and see how it works.
when linking a geocities swf, include the html and link the html. gc doesnt like off-account file linking.
and for anyone who runs across these gc direct swf links, the easiest way to get around them is to click the link once to pop up the window then click and drag the link into the new window. It will load fine then.
Actually I am creating this for my pocket pc. However the flash player in pocket pc only support version 5, yet if i export the program to version 5, the click can not work!
Haha…thanks a lot for the last file… but I can’t figure out a way to create layers above the one duplicated by arrays… so I end up copy them one by one…