Phillip Trelford's Array

POKE 36879,255

Missile Command

Just for fun, a clone of the 1980s arcade game Missile Command written in F# and deployed in Silverlight.


A language feature I have repeatedly found useful for games is state machines as sequences using yield. The following is used to define the path of explosions:

static member Path radius = seq {
    for i in [50..2..100] do
        yield radius * ((float i / 100.0) ** 3.0)
    for i in [100..-1..0] do
        yield radius * ((float i / 100.0) ** 3.0)
    }

 

References:

MissileCommand.zip (4.65 kb)

Pingbacks and trackbacks (1)+

Comments are closed