How to make set of pieces move as a g... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » How to make set of pieces move as a group « Previous Next »

Author Message
Matt Gokey (Mgokey)
Posted on Thursday, December 30, 2004 - 8:39 pm:   

Is there a way to have certain patterns of piece types occupying a set of positions act as a single aggregate piece and move or be acted upon as a group?
Karl Scherer (Karl)
Posted on Sunday, January 02, 2005 - 1:06 am:   

I suppose the "cascade" command can help you there.
Example: you want to shift one step towards south a piece, and also the pieces to the top right
(northeast) and to the bottom left (southwest)
of it.

To achieve this, you code:

(define Movesouth ( ;move three diag. pieces
mark ;remember where you came from
from s to ;move this piece with your cursor
cascade back ne from s to ;move this one automatically
cascade sw from s to ;move this one also automatically

add
))

I suppose you can see how this method can be applied to all sorts of groups of pieces.
If you want to make sure all these pieces are pawns, you may code:

(define Movesouth ( ;move three diag. pieces
mark ;remember where you came from
from s to ;move this piece with your cursor
cascade back ne
(verify (piece? pawn))
from s to ;move this one automatically
cascade sw
(verify (piece? pawn))
from s to ;move this one also automatically

add
))

Cheers, Karl

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: