User Tools

Site Tools


en:guides:beginners:exploding_monsters

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
en:guides:beginners:exploding_monsters [2018/02/14 04:47 (9 months ago)]
iarwain ↷ Links adapted because of a move operation
en:guides:beginners:exploding_monsters [2018/06/28 13:04 (5 months ago)] (current)
sausage In line with init projects
Line 5: Line 5:
 {{ :​guides:​beginners:​jelly.png?​nolink |}} {{ :​guides:​beginners:​jelly.png?​nolink |}}
  
-Right click and save this image into the data/anim folder as "​jelly.png"​.+Right click and save this image into the ''​data/texture'' ​folder ​of our project ​as "​jelly.png"​.
  
 Every monster will explode into several of these jelly objects when shot. Every monster will explode into several of these jelly objects when shot.
Line 19: Line 19:
 </​code>​ </​code>​
  
-Then an individual JellyObject:​+Then an individual ​''​JellyObject''​:
  
 <​code=ini>​ <​code=ini>​
Line 26: Line 26:
 AnimationSet = JellyAnimationSet AnimationSet = JellyAnimationSet
 Speed        = (-50, -50, 0) ~ (50, -50, 0) Speed        = (-50, -50, 0) ~ (50, -50, 0)
-Position ​    = (400, 0, 0)+Position ​    = (0, -300, 0)
 Body         = JellyBody Body         = JellyBody
 </​code>​ </​code>​
Line 43: Line 43:
  
 [JellyWobbleAnim] [JellyWobbleAnim]
-KeyDuration = 0.05+KeyDuration = 0.08
  
 </​code>​ </​code>​
  
-Then the jelly needs a body. This is so the bits will bounce nicely over the platforms:+The jelly needs a body. This is so the bits will bounce nicely over the platforms:
  
 <​code=ini>​ <​code=ini>​
Line 62: Line 62:
 </​code>​ </​code>​
  
-Then let the platforms know about the jelly mask:+Then let the platforms know about the jelly, by adding it the platform'​s ​mask:
  
 <​code=ini>​ <​code=ini>​
Line 88: Line 88:
  
  
-That's not bad, but really... the animation frame setup isn't quite what we're after. In our ''​JellyAnimationSet''​ we're just letting Orx automatically take the three frames in the sprite sheet. ​But really, we need four frames:+That's not bad, but really... the animation frame setup isn't quite what we're after. In our ''​JellyAnimationSet''​ we're just letting Orx automatically take the three frames in the sprite sheet. ​We really need four frames:
  
   * Frame 1   * Frame 1
Line 95: Line 95:
   * Frame 3   * Frame 3
  
-That is how the animation should be. Thankfully Orx will let us specify the frames for an animation manually. Add the following config to set this up:+That is how the animation should be. Thankfully Orx will let us specify the third and fourth ​frames for an animation manually. Add the following config to set this up:
  
 <​code=ini>​ <​code=ini>​
Line 105: Line 105:
 </​code>​ </​code>​
  
-Great. By using the name of the animation (''​JellyWobbleAnim''​) + the frame number, now frames 3 and 4 are overriden ​in the sheet while frames 1 and 2 are picked up automatically by Orx.+Great. By using the name of the animation (''​JellyWobbleAnim''​) + the frame number, now frames 3 and 4 are overridden ​in the sheet while frames 1 and 2 are picked up automatically by Orx.
  
-The next step is to create an explosion object. This will be an empty object that contains a spawner. The spawner will shoot out five jellys. These explosion objects can be placed on any monster for dramatic effect:+The next step is to create an explosion object. This will be an empty object that contains a spawner. The spawner will shoot out five jellies. These explosion objects can be placed on any monster for dramatic effect:
  
 <​code=ini>​ <​code=ini>​
Line 146: Line 146:
 </​code>​ </​code>​
  
-Also remove the Position parameter from the JellyObject because these will soon be dynamically placed. Also change the Speed parameter to be more dramatic:+Also remove the ''​Position'' ​parameter from the ''​JellyObject'' ​because these will soon be dynamically placed. Also change the ''​Speed'' ​parameter to be more dramatic:
  
 <​code=ini>​ <​code=ini>​
Line 176: Line 176:
 </​code>​ </​code>​
  
-The bullets are not affected by gravity (Dynamic) nor do they bounce off other objects (Solid).+The bullets are not affected by gravity (not Dynamic) nor do they bounce off other objects (not Solid).
  
 In order to make a monster explode, we can make a function in the code which will create a exploder object on top off a monster object, and then destroy the monster itself: In order to make a monster explode, we can make a function in the code which will create a exploder object on top off a monster object, and then destroy the monster itself:
Line 196: Line 196:
 </​code>​ </​code>​
  
-We are passing in a named exploderObjectName so that we can use this function later for other exploders we'll make.+We are passing in a named exploderObjectName so that we can re-use this function later for other exploders we'll make.
  
  
Line 215: Line 215:
 </​code>​ </​code>​
  
-So in both cases, create the JellyExplosion on top of a monster, then destroy both the monster and the bullet that hit it.+So in both cases, create the ''​JellyExplosion'' ​on top of a monster, then destroy both the monster and the bullet that hit it.
  
 Compile and run. You'll get some crazy jelly action all over the screen: Compile and run. You'll get some crazy jelly action all over the screen:
Line 221: Line 221:
 {{:​guides:​beginners:​beginners-45-jelly-explosions.png?​nolink|}} {{:​guides:​beginners:​beginners-45-jelly-explosions.png?​nolink|}}
  
-The jelly blobs never dissapear. Fix that by giving it a specific lifetime:+The jelly blobs never disappear. Fix that by giving it a specific lifetime:
  
 <​code=ini>​ <​code=ini>​
en/guides/beginners/exploding_monsters.txt · Last modified: 2018/06/28 13:04 (5 months ago) by sausage