This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:community:sausage:particle_explosions [2015/12/06 12:10 (8 years ago)] – external edit 127.0.0.1 | en:tutorials:animation:particle_explosions [2020/08/31 06:54 (4 years ago)] (current) – ↷ Page moved from en:tutorials:community:sausage:particle_explosions to en:tutorials:animation:particle_explosions sausage | ||
---|---|---|---|
Line 13: | Line 13: | ||
This blank object can be placed anywhere. We'll limit it to 10 spawned particle objects, then it will die. We are looking for this kind of effect (though a still image doesn' | This blank object can be placed anywhere. We'll limit it to 10 spawned particle objects, then it will die. We are looking for this kind of effect (though a still image doesn' | ||
- | {{tutorials: | + | {{tutorials: |
For this tutorial, the mouse will be used to set an explosion. Click anywhere on screen, and you can click as much and as quickly as you like to fill the screen with booms. | For this tutorial, the mouse will be used to set an explosion. Click anywhere on screen, and you can click as much and as quickly as you like to fill the screen with booms. | ||
Line 65: | Line 65: | ||
===== ExplodeAt() And Graphic ===== | ===== ExplodeAt() And Graphic ===== | ||
- | An ExplodeAt() | + | An ExplodeAt() |
- | The ExplodeAt() | + | The ExplodeAt() |
<code c> | <code c> | ||
void ExplodeAt(orxVECTOR position){ | void ExplodeAt(orxVECTOR position){ | ||
- | |||
- | orxVECTOR someObject; | ||
orxOBJECT *explosion = orxObject_CreateFromConfig(" | orxOBJECT *explosion = orxObject_CreateFromConfig(" | ||
orxObject_SetPosition(explosion, | orxObject_SetPosition(explosion, | ||
Line 83: | Line 81: | ||
Now, what are our explosion frames going to look like? Below are the animation frames of a single sub-explosion. This is a 594 x 46 pixel animation sprite set, each frame being 46 x 46 pixels: | Now, what are our explosion frames going to look like? Below are the animation frames of a single sub-explosion. This is a 594 x 46 pixel animation sprite set, each frame being 46 x 46 pixels: | ||
- | {{tutorials: | + | {{tutorials: |
As mentioned at the beginning, the blank explosion object will have a spawner, and this spawner will spawn 10 copies of these individual sub-explosions. Each will follow quickly after the other and be randomly placed away from the centre blank object. This will help the explosion look a little more natural. And each will be different from the last. | As mentioned at the beginning, the blank explosion object will have a spawner, and this spawner will spawn 10 copies of these individual sub-explosions. Each will follow quickly after the other and be randomly placed away from the centre blank object. This will help the explosion look a little more natural. And each will be different from the last. | ||
Line 94: | Line 92: | ||
<code ini> | <code ini> | ||
- | [Mouse] | + | [Mouse] |
- | ShowCursor = true | + | ShowCursor = true |
- | [Display] | + | [Display] |
- | ScreenWidth | + | ScreenWidth |
- | ScreenHeight | + | ScreenHeight |
- | Title = Explosions | + | Title = Explosions |
- | [Tutorial] | + | [Viewport] |
+ | Camera | ||
+ | BackgroundColor = (40, 40, 100) | ||
- | [Viewport] | + | [Camera] |
- | Camera | + | FrustumWidth |
- | BackgroundColor = (40, 40, 100) | + | FrustumHeight = @Display.ScreenHeight |
- | + | FrustumFar | |
- | + | Position | |
- | [Camera] | + | |
- | FrustumWidth | + | |
- | FrustumHeight = @Display.ScreenHeight | + | |
- | FrustumFar | + | |
- | Position | + | |
</ | </ | ||
Line 123: | Line 118: | ||
<code ini> | <code ini> | ||
- | [ExplosionSet] | + | [ExplodeObject] ;explosion object, the actual orange flare |
- | AnimationList = ExplodeAnim | + | Graphic = ExplodeGraphic ;supplies |
- | + | AnimationSet = ExplosionSet | |
- | [ExplodeAnim] | + | Position |
- | DefaultKeyDuration | + | LifeTime |
- | KeyData1 | + | |
- | KeyData2 | + | [ExplodeGraphic] |
- | KeyData3 | + | Texture |
- | KeyData4 | + | TextureSize = (46, 46, 0) |
- | KeyData5 | + | Pivot = center |
- | KeyData6 | + | |
- | KeyData7 | + | |
- | KeyData8 | + | |
- | KeyData9 | + | |
- | KeyData10 | + | |
- | KeyData11 | + | |
- | KeyData12 | + | |
- | KeyData13 | + | |
- | + | ||
- | [ExplodeObject] ;explosion object, the actual orange flare | + | |
- | Graphic = explode1 ;default image to start | + | |
- | AnimationSet = ExplosionSet | + | |
- | Position | + | |
- | LifeTime | + | |
- | [ExplodeGraphic] | + | [ExplosionSet] |
- | Texture = ../ | + | Texture |
- | TextureSize | + | KeyDuration |
- | Pivot = center | + | StartAnim |
+ | FrameSize | ||
+ | ExplodeAnim-> | ||
- | [explode1@ExplodeGraphic] | ||
- | TextureCorner = (0, 0, 0) | ||
- | |||
- | [explode2@ExplodeGraphic] | ||
- | TextureCorner = (46, 0, 0) | ||
- | |||
- | [explode3@ExplodeGraphic] | ||
- | TextureCorner = (92, 0, 0) | ||
- | |||
- | [explode4@ExplodeGraphic] | ||
- | TextureCorner = (138, 0, 0) | ||
- | |||
- | [explode5@ExplodeGraphic] | ||
- | TextureCorner = (184, 0, 0) | ||
- | |||
- | [explode6@ExplodeGraphic] | ||
- | TextureCorner = (230, 0, 0) | ||
- | |||
- | [explode7@ExplodeGraphic] | ||
- | TextureCorner = (276, 0, 0) | ||
- | |||
- | [explode8@ExplodeGraphic] | ||
- | TextureCorner = (322, 0, 0) | ||
- | |||
- | [explode9@ExplodeGraphic] | ||
- | TextureCorner = (368, 0, 0) | ||
- | |||
- | [explode10@ExplodeGraphic] | ||
- | TextureCorner = (414, 0, 0) | ||
- | |||
- | [explode11@ExplodeGraphic] | ||
- | TextureCorner = (460, 0, 0) | ||
- | |||
- | [explode12@ExplodeGraphic] | ||
- | TextureCorner = (506, 0, 0) | ||
- | |||
- | [explode13@ExplodeGraphic] | ||
- | TextureCorner = (552, 0, 0) | ||
</ | </ | ||
Line 199: | Line 144: | ||
<code ini> | <code ini> | ||
- | [Exploder] ; | + | [Exploder] ; |
- | Spawner = ExplosionSpawner | + | Spawner |
- | Position = (100,100,0) | + | Position = (100,100,0) |
- | LifeTime = 2 ;< | + | LifeTime = 2 ;< |
- | [ExplosionSpawner] | + | [ExplosionSpawner] |
- | Object = ExplodeObject | + | Object = ExplodeObject |
- | TotalObject = 10 ;< | + | TotalObject = 10 ;< |
- | WaveSize = 1 | + | WaveSize = 1 |
- | WaveDelay = 0.02 | + | WaveDelay = 0.02 |
</ | </ | ||