User Tools

Site Tools


en:tutorials:animation:particle_explosions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:community:sausage:particle_explosions [2016/11/21 04:44 (7 years ago)] – Line not required sausageen: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't do it justice): 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't do it justice):
  
-{{tutorials:community:sausage:explode-screenshot.png|}}+{{tutorials:animation:explode-screenshot.png|}}
  
 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() method being called. This is where we create a an explosion and position it. We'll send it our current mouse position.+An ExplodeAt() function being called. This is where we create a an explosion and position it. We'll send it our current mouse position.
  
  
-The ExplodeAt() method looks like this:+The ExplodeAt() function looks like this:
  
 <code c> <code c>
Line 81: 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:community:sausage:explosion.png|}}+{{tutorials:animation:explosion.png|}}
  
 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 92: Line 92:
  
 <code ini> <code ini>
- [Mouse] +[Mouse] 
- ShowCursor = true+ShowCursor = true
  
- [Display] +[Display] 
- ScreenWidth    = 640 +ScreenWidth    = 640 
- ScreenHeight  = 480 +ScreenHeight  = 480 
- Title = Explosions+Title = Explosions
  
- [Tutorial]+[Viewport] 
 +Camera          = Camera 
 +BackgroundColor = (40, 40, 100)
  
  
- [Viewport] +[Camera] 
- Camera          = Camera +FrustumWidth  = @Display.ScreenWidth 
- BackgroundColor = (40, 40, 100) +FrustumHeight = @Display.ScreenHeight 
- +FrustumFar    = 2.0 
- +Position      = (320.0, 240.0, -1.0)
- [Camera] +
- FrustumWidth  = @Display.ScreenWidth +
- FrustumHeight = @Display.ScreenHeight +
- FrustumFar    = 2.0 +
- Position      = (320.0, 240.0, -1.0)+
 </code> </code>
  
Line 121: Line 118:
  
 <code ini> <code ini>
- [ExplosionSet] +[ExplodeObject] ;explosion object, the actual orange flare 
- AnimationList = ExplodeAnim +Graphic ExplodeGraphic ;supplies default image size for all frames  
- +AnimationSet = ExplosionSet 
- [ExplodeAnim] +Position  = (-20,-20,0) ~ (20,20,0)  ;<--- random positions offset from the centre of the explosion core 
- DefaultKeyDuration  = 0.03;  +LifeTime  = 0.35  ;<!--- each sub-explosion will die after 0.35 seconds. 
- KeyData1            = explode1 +  
- KeyData2            = explode2 +[ExplodeGraphic] 
- KeyData3            = explode3 +Texture     = explosion.png 
- KeyData4            = explode4 +TextureSize = (46, 46, 0) 
- KeyData5            = explode5 +Pivot       = center
- KeyData6            = explode6 +
- KeyData7            = explode7 +
- KeyData8            = explode8 +
- KeyData9            = explode9 +
- KeyData10            = explode10 +
- KeyData11            = explode11 +
- KeyData12            = explode12 +
- KeyData13            = explode13 +
- +
- [ExplodeObject] ;explosion object, the actual orange flare +
- Graphic explode1 ;default image to start +
- AnimationSet = ExplosionSet +
- Position  = (-20,-20,0) ~ (20,20,0)  ;<--- random positions offset from the centre of the explosion core +
- LifeTime  = 0.35  ;<!--- each sub-explosion will die after 0.35 seconds.+
  
- [ExplodeGraphic+[ExplosionSet
- Texture = ../../data/anim/explosion.png +Texture       = explosion.png 
- TextureSize = (46, 46, 0) +KeyDuration   = 0.03 
- Pivot   center+StartAnim     = ExplodeAnim      ; Ensure our only animation is the default. 
 +FrameSize     = (46, 46, 0) 
 +ExplodeAnim->                  ; After ExplodeAnim has completed, go nowhere. Stop animating.
  
- [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) 
 </code> </code>
  
Line 197: Line 144:
  
 <code ini> <code ini>
- [Exploder] ;invisible object +[Exploder] ;invisible object 
- Spawner = ExplosionSpawner +Spawner  = ExplosionSpawner 
- Position = (100,100,0)  +Position = (100,100,0)  
- LifeTime = 2 ;<--- Each blank explosion object will die after 2 seconds.+LifeTime = 2 ;<--- Each blank explosion object will die after 2 seconds.
  
- [ExplosionSpawner] +[ExplosionSpawner] 
- Object = ExplodeObject +Object = ExplodeObject 
- TotalObject = 10 ;<!-- only have 10 sub-explosions +TotalObject = 10 ;<!-- only have 10 sub-explosions 
- WaveSize = 1 +WaveSize = 1 
- WaveDelay = 0.02+WaveDelay = 0.02
 </code> </code>
   
en/tutorials/animation/particle_explosions.1479732258.txt.gz · Last modified: 2017/05/30 00:50 (7 years ago) (external edit)