This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:guides:beginners:exploding_monsters [2019/09/11 02:14 (6 years ago)] – external edit 127.0.0.1 | en: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' | Then let the platforms know about the jelly, by adding it the platform' | ||
- | < | + | < |
[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: | ||
- | < | + | < |
[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: | ||
- | < | + | < |
[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: | ||
- | < | + | < |
[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: | ||
- | < | + | < |
[BulletObject] | [BulletObject] | ||
Graphic | Graphic | ||
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: | ||
- | < | + | < |
+ | if (orxString_Compare(recipientObjectName, | ||
+ | orxObject_SetLifeTime(pstRecipientObject, | ||
+ | } | ||
+ | | ||
if (orxString_Compare(senderObjectName, | if (orxString_Compare(senderObjectName, | ||
CreateExplosionAtObject(pstRecipientObject, | CreateExplosionAtObject(pstRecipientObject, | ||
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: | ||
- | < | + | < |
[JellyObject] | [JellyObject] | ||
Graphic | Graphic |