How to put 2 pieces onto 1 position -... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » How to put 2 pieces onto 1 position - practical workaround. « Previous Next »

Author Message
Karl Scherer (Karl)
Posted on Friday, February 02, 2001 - 9:10 am:   

Here is a practical solution of how to put two pieces onto one position WITHOUT creating
all combinations of the two piece-types.

General description:
In the board definition,
define smaller position-rectangles on top of the existing position-rectangles.

Display the image for the (larger) original position first, then display the piece at the smaller position-rectangle (for example with 'change-type').
Only make the smaller piece sensitive for moves/drops.

This method saves you from having to create and handle the big number of images and piece-types
when you want to allow two pieces on the same
board-position.

1st Application Example: Chess
Use the normal Chess position (say a1) as big
position, then a smaller rectangle slightly off-
centre to the left as smaller image.
That way the first chess piece will be partly visible.
In the larger image you might have to shift the Chess piece slightly
to the right.

2nd Application Example: Capetown.
In my new game Capetown (out in a few days)
I faced the seemingly unsolvable problem
that I wanted as piece-types eight letters
(C, A, P, E, T, O, W, N) rotated in 4 ways each
and displayed in six colours each, which would
result in 8 x 4 x 6 = 192 images and piece-types!

I shied away from this unwieldy standard solution until I came across the above workaround which I
applied to Capetown in the following way:

On the standard board position, I display a colour frame.
On top of this I display a somewhat smaller image of the letters, each in one of four rotations.
This way I only had to create and handle 4x8 + 6 = 38 images and piece-types instead of 192.

The only disadvantage of this method is that
the sensitive input area is smaller than the
orginal position-rectangle.

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: