| Author |
Message |
Ingrid Lael (Ingridlael)
| | Posted on Sunday, January 15, 2006 - 9:31 pm: | |
Hi there, I've been trying to imlpement an Ultima variant wich has a piece whose move code eludes me. In a single turn the piece may: 1- OPTIONALLY move Queen-wise. 2- push every piece around it (friend or foe) one square away (if it gets pushed off the board then its considered a capture). If the piece does not move, and decides to push, it needs to have at least another piece (friend or foe) around it (cuz if it needn't, then it could be an "implicit" pass-turn). One more detail: the owner of the pusher can choose the ORDER in wich the pieces are pushed. This is what I came out with: (define push ($1 (verify not-empty?) from $1 (verify empty?) to (add-partial push-move))) and the move block goes (for a non-displacing push-only move): (moves ....(move-type push-move) ....(push n) ....(push ne) ....(push e) ....(push se) ....(push s) ....(push sw) ....(push w) ....(push nw) ) The thing with this code is: 1) I actually need to take the pushed piece and move it to the push destination, not the pusher. 2) After I push one piece away I cannot keep on pushing other pieces (although they CAN be pushed). I'm most certainly doing something wrong, but it keeps eluding me, PLEASE help! Cheers... ...Ingrid |
Karl Scherer (Karl)
| | Posted on Tuesday, January 17, 2006 - 7:26 am: | |
Seems to me that you want to move the pusher and implicitly move the pushed piece. Many games have a similar feature. It is implemented by using the ==> cascade <== command: from $1 to cascade from $1 to add |
Ingrid Lael (Ingridlael)
| | Posted on Tuesday, January 17, 2006 - 8:26 am: | |
Yup, I actually want the pusher to be able to stay in its place whilst being able to push other pieces away from him. The thing is that when pushing my own pieces (they all move like chess kings for now) ZoG thinks I'm trying to move, not push them. It's pretty annpying. I'll check the snippet and report back Thanks!! |
Karl Scherer (Karl)
| | Posted on Saturday, January 21, 2006 - 5:30 am: | |
Well, if you don't move, you just drop a piece onto your pusher an use capture and create to move the other piece. I can't quite see where your problem is here. Cheers, Karl |
Ingrid Lael (Ingridlael)
| | Posted on Saturday, January 21, 2006 - 9:57 am: | |
First off: sorry for the cross-posting, I didn't notice it, my bad. On the other hand, you're right, a drop could do the trick. I'll check that one up, thanks. Cheers... ...Ingrid. |
|