コード例 #1
0
ファイル: engine.go プロジェクト: monopole/volley
func (gn *Engine) throwOneBall(b *model.Ball, direction model.Direction) {
	// Before throwing, normalize the Y coordinate to a dimensionless
	// percentage.  Recipient converts it based on their own dimensions,
	// so that if the ball left one tenth of the way up the screen, it
	// enters the next screen at the same relative position.
	b.SetPos(b.GetPos().X, b.GetPos().Y/gn.scn.Height())
	gn.chBallCommand <- model.BallCommand{b, direction}
}