This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:guides:beginners:survival [2018/02/13 20:47 (8 years ago)] – ↷ Page moved from guides:beginners:survival to en:guides:beginners:survival iarwain | en:guides:beginners:survival [2024/11/19 03:56 (10 months ago)] (current) – Highlights sausage | ||
---|---|---|---|
Line 3: | Line 3: | ||
Keeping alive is key in a platformer. The monsters need to be a threat to our hero. If a monster touches our hero, he should explode in a shower of bits. That's game over. | Keeping alive is key in a platformer. The monsters need to be a threat to our hero. If a monster touches our hero, he should explode in a shower of bits. That's game over. | ||
- | For the explosion for our hero, let' | + | For the explosion for our hero, let' |
{{ : | {{ : | ||
Line 11: | Line 11: | ||
< | < | ||
[SparkGraphic] | [SparkGraphic] | ||
- | Texture = +.png | + | Texture = plus.png |
Pivot = center | Pivot = center | ||
Line 24: | Line 24: | ||
</ | </ | ||
- | Each SparkObject will fly up and out in a random direction, random colours, sizes, and a random lifetime. 50 at a time should look good. Next, make a body for it so that it will fall back to earth: | + | Each '' |
< | < | ||
Line 38: | Line 38: | ||
A pretty simple body and part - affected by gravity but not set to collide with anything. | A pretty simple body and part - affected by gravity but not set to collide with anything. | ||
- | Finally, we'll make an empty hero exploder with a spawner that spawns out 50 SparkObject' | + | <WRAP center round tip 80%> |
+ | Note that giving each particle a body is an easy way to make objects fall to the ground, but it is also heavy and in-efficient. While we won't do it in this guide, an FX can also be a cheap way to make object fall down. See this tutorial if you would like to learn how: [[en: | ||
+ | </ | ||
+ | |||
+ | Finally, we'll make an empty hero exploder with a spawner that spawns out 50 '' | ||
< | < | ||
Line 53: | Line 57: | ||
Before we can deal with the collision between monster and hero, we need to ensure the flags of the hero knows about monsters: | Before we can deal with the collision between monster and hero, we need to ensure the flags of the hero knows about monsters: | ||
- | < | + | < |
[HeroBodyPart] | [HeroBodyPart] | ||
Type = box | Type = box | ||
Line 61: | Line 65: | ||
</ | </ | ||
- | Now to handle it in code: | + | Now to handle it in code, by adding the following at the bottom of the '' |
< | < | ||
Line 81: | Line 85: | ||
</ | </ | ||
- | So if the hero and the monster touch, disable the hero and place a HeroExploder on top of him. | + | So if the hero and the monster touch, destroy the monster, disable the hero and place a '' |
Compile and run it: | Compile and run it: | ||
Line 92: | Line 96: | ||
---- | ---- | ||
- | Next: [[guides: | + | Next: [[en:guides: |
- | {{section> | + | {{section> |