
include landscape1
landscape1 400 5 20

// draw the mothership..
pu; moveto 500 550; logo fillcolor = "dullyellow"; pd; ellipse 120 30; fillshape
pu; moveto 500 540; logo fillcolor = "black"; pd; ellipse 120 30; fillshape

// load the wham pattern..
pointlist startcapture
 pointlist loadfile "ptsfiles/wham.pts"
pointlist endcapture


// now make phaser fire..
message "Phaser " "Stop"

repeat untilbreak [
  if keypress = 1 [ break ]

  wait calc 10 + random 60  // wait a random amount of time..

  // set a random location for each shot..
  set ypos = calc 100 + random 280
  set xpos = random winwide

  logo linecolor = "powderblue"

  // determine where to draw the phaser line from saucer to alien..
  pu; moveto 500 510
  pd; moveto :xpos :ypos; pu

  set whamsize = calc 80 / :ypos   // make it smaller when "further away"..
  logo linecolor "orange"
  pointlist render :xpos :ypos :whamsize // show the wham pattern..
    
  // now erase the phaser line & wham..
  wait 10
  logo linecolor "black"
  pointlist render :xpos :ypos :whamsize
  logo linecolor "darkblue"
  pu; moveto :xpos :ypos; pd; moveto 500 510

  ]
