This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
en:guides:beginners:text_and_game_over [2018/02/13 20:47 (6 years ago)] – ↷ Links adapted because of a move operation iarwain | en:guides:beginners:text_and_game_over [2018/06/29 05:38 (6 years ago)] – In line with init projects sausage | ||
---|---|---|---|
Line 15: | Line 15: | ||
[ScoreObject] | [ScoreObject] | ||
Graphic | Graphic | ||
- | Position = (20, 20, 0) | + | Position = (-380, -280, 0) |
</ | </ | ||
- | Interesting to note the special Text definition. ScoreGraphic uses this instead of a texture from file. And the ScoreObject uses the graphic section as others before. | + | Interesting to note the special |
Now, in code, add a score variable and a scoreObject at the top of the file: | Now, in code, add a score variable and a scoreObject at the top of the file: | ||
Line 48: | Line 48: | ||
</ | </ | ||
- | Add 250 points whenever a monster is hit with a bullet: | + | Add 250 points whenever a monster is hit with a bullet. Add UpdateScore() function calls to: |
< | < | ||
Line 66: | Line 66: | ||
</ | </ | ||
- | And of course, 1000 points bonus if the star is reached: | + | And of course, 1000 points bonus if the star is reached. Add the following code: |
< | < | ||
Line 88: | Line 88: | ||
{{ tutorials: | {{ tutorials: | ||
- | Save this into the data/object | + | Save this into the '' |
Create a simple gameover graphic and object: | Create a simple gameover graphic and object: | ||
Line 95: | Line 95: | ||
[GameOverGraphic] | [GameOverGraphic] | ||
Texture = gameover.png | Texture = gameover.png | ||
+ | Pivot = center | ||
[GameOverObject] | [GameOverObject] | ||
Graphic | Graphic | ||
- | Position = (280, 250, -0.1) | + | Position = (0, 0, -0.1) |
</ | </ | ||
- | Create a timeline track with a single command to create the GameOverObject: | + | Create a timeline track with a single command to create the '' |
< | < | ||
Line 108: | Line 109: | ||
</ | </ | ||
- | Then finally | + | Then finally, change |
< | < | ||
Line 140: | Line 141: | ||
</ | </ | ||
- | And then set the variable on the orxObject_CreateFromConfig(" | + | And then set the '' |
< | < |