| Author |
Message |
epicurus (Epicurus)
New member Username: Epicurus
Post Number: 8 Registered: 11-2012
| | Posted on Friday, November 30, 2012 - 8:24 am: | |
Hi, I am designing a game with multiple move per turn. I would like to have a button for passing, just outside the board. But when I press the pass-button, I want pass all the rest of the turn. For example, if I have 3 moves left, when I press the pass-button I want 3 passes to be generated. How can I do that? Thanks. |
Greg Schmidt (Gschmidt2)
New member Username: Gschmidt2
Post Number: 151 Registered: 1-2007
| | Posted on Friday, November 30, 2012 - 2:23 pm: | |
Hi old friend , One way to do it is to not use the built-in "pass". Instead, create a dummy position "pass_pos" and a dummy piece "pass_piece". All your "pass button" should do is to create "pass_piece" on "pass_pos". The 3 moves will check to see if "pass_piece" is present on "pass_pos" and if so, will do nothing. In addition, the 3rd move will remove (capture) "pass_piece". |
epicurus (Epicurus)
New member Username: Epicurus
Post Number: 9 Registered: 11-2012
| | Posted on Monday, December 03, 2012 - 1:26 pm: | |
Hi Greg ;), thanks for your help. At the beginning I had some problems to implement this solution because I was asking myself "how can I program the behaviour of a button/position if I can just program a piece behaviour?". At the end I solve the problem. :D If someone will need this solution here it is in detail. (dummy pass_piece) (positions (pass_pos 396 190 418 212)) [...] (board-setup (White [...] (pass_piece off 1000) ) (Black [...] (pass_piece off 1000) ) ) [...] (piece (name pass_piece) (drops (move-type normal) (pass-move) ) ) (define pass-move ( (verify (not-friend? pass_pos)) pass_pos add) ) |
epicurus (Epicurus)
New member Username: Epicurus
Post Number: 10 Registered: 11-2012
| | Posted on Monday, December 03, 2012 - 6:27 pm: | |
I forgot: (pass-turn forced) |