Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 35 | chris | 1 | unit app_particle_powerupappears; |
| 2 | |||
| 3 | interface |
||
| 4 | |||
| 5 | uses sux_constant, sux_object, app_constant, resource_texture, |
||
| 6 | resource_list, app_particle_main, app_particle_part; |
||
| 7 | |||
| 8 | type |
||
| 9 | TPowerUp=record |
||
| 10 | end; |
||
| 11 | SAPPowerUpAppears=class(SAParticle) |
||
| 12 | powerup: TPowerUp; |
||
| 13 | |||
| 14 | procedure createBubbles(const pos: SXVertex2D); |
||
| 15 | |||
| 16 | procedure onTimer; override; |
||
| 17 | |||
| 18 | procedure initialize; override; |
||
| 19 | constructor Create(const parent: TObject); |
||
| 20 | destructor Destroy; override; |
||
| 21 | end; |
||
| 22 | |||
| 23 | implementation |
||
| 24 | |||
| 25 | uses main, gl_main, OpenGL; |
||
| 26 | |||
| 27 | |||
| 28 | // --- SAPPowerUpAppears |
||
| 29 | |||
| 30 | |||
| 31 | procedure SAPPowerUpAppears.createBubbles(const pos: SXVertex2D); |
||
| 32 | var p: SXInt; |
||
| 33 | part: SAPPart; |
||
| 34 | partpos: SXVertex2D; |
||
| 35 | partmove: SXVertex2D; |
||
| 36 | begin |
||
| 37 | for p := 0 to 25 do |
||
| 38 | begin |
||
| 39 | partpos.x := pos.x + sx.math.random.getRandomFloat(-10, 10); |
||
| 40 | partpos.y := pos.y + sx.math.random.getRandomFloat(-10, 10); |
||
| 41 | part := addParticle(0, partpos, 180, sx.math.random.getRandomFloat(8, 15)); |
||
| 42 | part.setDensity(1.0); |
||
| 43 | |||
| 44 | partmove.x := sx.math.random.getRandomFloat(-1, 1); |
||
| 45 | partmove.y := sx.math.random.getRandomFloat(-1, 1); |
||
| 46 | partmove := sx.math.multiplyVertex(partmove, sx.math.random.getRandomFloat(30, 60)); |
||
| 47 | |||
| 48 | part.setAnimation(partmove, 0, -10, sx.convert.ColorRGBOf(0, 0, 0), 0); |
||
| 49 | end; |
||
| 50 | end; |
||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | |||
| 55 | procedure SAPPowerUpAppears.onTimer; |
||
| 56 | begin |
||
| 57 | onTimerParts; |
||
| 58 | deleteIfEmpty; |
||
| 59 | end; |
||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | procedure SAPPowerUpAppears.initialize; |
||
| 65 | begin |
||
| 66 | end; |
||
| 67 | |||
| 68 | |||
| 69 | constructor SAPPowerUpAppears.Create(const parent: TObject); |
||
| 70 | begin |
||
| 71 | inherited Create(parent); |
||
| 72 | |||
| 73 | setupAppearance(app.scene.board.settings.icon, 1); |
||
| 74 | setBlending(SX_GL_BLEND_ADDITIVE); |
||
| 75 | end; |
||
| 76 | |||
| 77 | |||
| 78 | destructor SAPPowerUpAppears.Destroy; |
||
| 79 | begin |
||
| 80 | inherited; |
||
| 81 | end; |
||
| 82 | |||
| 83 | |||
| 84 | end. |