Best way to allow moving enemy piece? Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Best way to allow moving enemy piece? « Previous Next »

Author Message
dhalgren (Dhalgren)
Posted on Wednesday, January 18, 2006 - 12:15 pm:   

I'd like to add code to a chess ZRF allowing players to either move a friendly piece or an enemy piece (if in a certain zone). What's the best way to implement this?
L. Lynn Smith (Interrupt27)
Posted on Thursday, January 19, 2006 - 8:28 am:   

Try making all the pieces neutral. Then assign the pieces different piece declaration according to their side with different move-types according to the condition of movement.

(turn-order
(White ?neutral white_moves)
(Black ?neutral black_moves)
)

This will mean that White will be able to move any neutral pieces according to the white_moves move-type regardless of the actual color of the pieces.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: