How to create a blocker piece Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » How to create a blocker piece « Previous Next »

Author Message
Harry Harris (Harry)
Posted on Monday, June 30, 2003 - 6:25 pm:   

Hello, I'm a newbie, starting to look at zrf code.

How can I create a blocker piece?

E.g. each player has a blocker, which they can move, but which can't capture or be captured or be jumped over, i.e. it functions as a movable hole on the board.

Thanks!

Harry
Jeff Mallett (Jeffm)
Posted on Monday, June 30, 2003 - 6:36 pm:   

1) In the move code for the blocker piece, only allow it to move to empty positions. The "empty?" keyword tests if a position is empty.
2) In the move code for all other pieces, before allowing a capture, check to make sure it's not the blocker piece. For example,
(if (not-piece? blocker) add)

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: