Permalink
Browse files

Add player shadow.

  • Loading branch information...
dmitshur committed Oct 20, 2017
1 parent 3904a4d commit d2dd88dfdbfa9dc1bdf00c5698c40b9740eb745c
Showing with 8 additions and 1 deletion.
  1. +8 −1 233/main.go
View
@@ -23,12 +23,19 @@ func paint() {
ctx.SetTransform(10, 0, 0, 10, 160, 160)
ctx.Rotate(-1.2)
gradient := ctx.CreateRadialGradient(0, 0, 8*1.75, 0, 0, 0)
gradient.AddColorStop(0, "rgba(0, 0, 0, 0)")
gradient.AddColorStop(1, "rgba(0, 0, 0, 0.3)")
ctx.Set("fillStyle", gradient)
ctx.Ellipse(0, 0, 8*1.75, 8*1.75, 0, 0, Tau, false)
ctx.Fill()
ctx.FillStyle = "red"
ctx.FillRect(2, -1, 11, 2)
ctx.BeginPath()
ctx.StrokeStyle = "red"
ctx.LineWidth = 2
ctx.BeginPath()
ctx.Ellipse(0, 0, 7, 7, Tau*1/12, 0, Tau*10/12, false)
ctx.Stroke()
}

0 comments on commit d2dd88d

Please sign in to comment.