Paste: the code that would be unique to this pattern

Author: william42
Mode: factor
Date: Fri, 28 May 2010 21:23:48
Plain Text |
: launch-beta ( x -- )
        [ enemy get
                120 frames
                0 >>yv
                { 2 4 6 } [ aim <bullet> fire ] each
                60 frames
                1 >>yv
        [ *coyield* t ] loop ] new-enemy
        swap >>x 0 >>xv -16 >>y 1 >>yv add-enemy ;

: launch-boss ( -- )
        [ enemy get
                240 frames
                0 >>yv
                [ 30 frames
                { -20 -10 0 10 20 }
                [ [ 1 aim ] dip turn <bullet> fire ] each t ]
        loop ] new-enemy
        32 >>yr 48 >>xr 600 >>health
        150 >>x 0 >>xv -16 >>y 0.5 >>yv add-enemy ;

: ship-pattern ( -- )
        60 frames
        50 launch-beta
        180 frames
        250 launch-beta
        180 frames
        150 launch-beta
        180 frames
        50 launch-beta
        250 launch-beta
        600 frames
        launch-boss
        [ *coyield* t ] loop ;

New Annotation

Summary:
Author:
Mode:
Body: