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 revisionPrevious revision
en:guides:beginners:exploding_monsters [2019/09/11 02:14 (6 years ago)] – external edit 127.0.0.1en:guides:beginners:exploding_monsters [2024/11/19 03:17 (5 months ago)] (current) – Highlights sausage
Line 64: Line 64:
 Then let the platforms know about the jelly, by adding it the platform's mask: Then let the platforms know about the jelly, by adding it the platform's mask:
  
-<code=ini>+<code=ini [highlight_lines_extra="5"]>
 [PlatformBodyPart] [PlatformBodyPart]
 Type        = box Type        = box
Line 74: Line 74:
 Test it by adding a JellyObject to the Scene section: Test it by adding a JellyObject to the Scene section:
  
-<code=ini>+<code=ini [highlight_lines_extra="5"]>
 [Scene] [Scene]
 ChildList = PlatformObject # MiddlePlatformObject # ChildList = PlatformObject # MiddlePlatformObject #
Line 122: Line 122:
 To test one of the these, remove the JellyObject from the Scene section and add the JellyExploder instead: To test one of the these, remove the JellyObject from the Scene section and add the JellyExploder instead:
  
-<code=ini>+<code=ini [highlight_lines_extra="5"]>
 [Scene] [Scene]
 ChildList = PlatformObject # MiddlePlatformObject # ChildList = PlatformObject # MiddlePlatformObject #
Line 137: Line 137:
 Great, we see a bunch of jelly blobs appear. Remove the JellyExploder from the Scene selector: Great, we see a bunch of jelly blobs appear. Remove the JellyExploder from the Scene selector:
  
-<code=ini>+<code=ini [highlight_lines_extra="5"]>
 [Scene] [Scene]
 ChildList = PlatformObject # MiddlePlatformObject # ChildList = PlatformObject # MiddlePlatformObject #
Line 158: Line 158:
 Next, we need to ensure that the BulletObject has a body and that it can collide with a monster: Next, we need to ensure that the BulletObject has a body and that it can collide with a monster:
  
-<code=ini>+<code=ini [highlight_lines_extra="4"]>
 [BulletObject] [BulletObject]
 Graphic  = BulletGraphic Graphic  = BulletGraphic
Line 164: Line 164:
 Scale    = 0.25 Scale    = 0.25
 Body     = BulletBody Body     = BulletBody
 +
  
 [BulletBody] [BulletBody]
Line 201: Line 202:
 Now to use it. In the physics event, add a check for collision between a bullet and a monster and process it: Now to use it. In the physics event, add a check for collision between a bullet and a monster and process it:
  
-<code=cpp>+<code=cpp [highlight_lines_extra="5,6,7,8,9,11,12,13,14,15"]> 
 +if (orxString_Compare(recipientObjectName, "StarObject") == 0){ 
 +    orxObject_SetLifeTime(pstRecipientObject, 0); 
 +
 +    
 if (orxString_Compare(senderObjectName, "BulletObject") == 0){ if (orxString_Compare(senderObjectName, "BulletObject") == 0){
     CreateExplosionAtObject(pstRecipientObject, "JellyExploder");     CreateExplosionAtObject(pstRecipientObject, "JellyExploder");
Line 223: Line 228:
 The jelly blobs never disappear. 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 [highlight_lines_extra="6"]>
 [JellyObject] [JellyObject]
 Graphic      = JellyGraphic Graphic      = JellyGraphic
en/guides/beginners/exploding_monsters.1568193276.txt.gz · Last modified: 2019/09/11 02:14 (6 years ago) by 127.0.0.1