(x, y int)
| 66 | } |
| 67 | |
| 68 | func (ctrl *Control) Emit(x, y int) { |
| 69 | component := ctrl.Root.Object("emitterComponent") |
| 70 | for i := 0; i < 8; i++ { |
| 71 | emitter := component.Create(nil) |
| 72 | emitter.Set("x", x) |
| 73 | emitter.Set("y", y) |
| 74 | emitter.Set("targetX", rand.Intn(240)-120+x) |
| 75 | emitter.Set("targetY", rand.Intn(240)-120+y) |
| 76 | emitter.Set("life", rand.Intn(2400)+200) |
| 77 | emitter.Set("emitRate", rand.Intn(32)+32) |
| 78 | emitter.ObjectByName("xAnim").Call("start") |
| 79 | emitter.ObjectByName("yAnim").Call("start") |
| 80 | emitter.Set("enabled", true) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | func (ctrl *Control) Done(emitter qml.Object) { |
| 85 | emitter.Destroy() |
no test coverage detected