BDCFF Object 0005: Expanding wall

Object number: $0005
Game class: Boulder Dash (by Peter Liepa)
Object name: Expanding wall

In this document:


Properties

Animate: yes
Impact explosive: no
Chain explosion action: consumed
Explosion type: n/a
Rounded: no


Attributes

Attribute format: %00000000 00000000

There are no attributes for this object type.


Graphics

Brick wall graphic
Expanding wall looks identical to brick wall.

Specification

Expanding wall looks identical to brick wall, but is not rounded; things don't roll off it.

Expanding wall "grows" sideways whenever possible. If ever a piece of expanding wall discovers that the position to the immediate left or right is empty space, it grows to fill that space. A piece of expanding wall can expand to fill both the left and the right spaces in one frame. However, the newly created pieces of expanding wall don't get to themselves grow until the next frame, so if you put a piece of expanding wall into a cave of space, you will see it expanding left and right at the rate of one space per frame.

Each time expanding wall grows, an appropriate sound is made (failing all else, just the standard boulder crash sound, the same as is used when a boulder starts or stops falling, or is pushed).


General Algorithm

procedure ScanExpandingWall(in positionType wallPosition) 
# Local variables
    positionType NewPosition;

# Try to grow left
    NewPosition := GetRelativePosition(wallPosition, left1);
    if (GetObjectAtPosition(NewPosition) == objSpace) then
        PlaceObject(objExpandingWall, attribNone, NewPosition);
    endif

# Try to grow right
    NewPosition := GetRelativePosition(wallPosition, right1);
    if (GetObjectAtPosition(NewPosition) == objSpace) then
        PlaceObject(objExpandingWall, attribNone, NewPosition);
    endif
endprocedure

Web page design by Peter Broadribb