I'll make this quick. Plenty of games show you in the top corner with a cute heart or broken heart how many lust or love points we have with each character.
I already have the points system enabled, and it works perfectly as far as "If 6 lust points. then this route, else, then THIS route."
So what code will allow me to show the player how many points they have as they go?
If you also know the code for where I may put an image such as said heart or broken heart, what is that code.
Thank you
@bossapplesauce is correct that what you need to do is build a screen, and then "show" it. Note that the screen doesn't have to have its code in "screens.rpy," however - you can put any Renpy code you want in any .rpy file you want, and Renpy will merge them all together. So there's nothing magic about the screen names.
Screens are defined using Ren'py's "screen language" (duh!) The simplest case for you would be:
Code:
screen points_screen():
text "[player_points]" align(0.0, 0.0)
This creates a screen named "points_screen" which has a single item - a text element that will display the "player_points" variable, aligned to the left, top corner of the screen. You'll probably want to deal with color, slightly better position, font size, etc., all of which can be done with modifiers to the text element.
Having created what you want, as
@bossapplesauce mentioned, you just execute a "show screen points_screen" command as part of your script. This will cause your screen to be displayed effectively as an overlay on the rest of the game. If you need to hide the points, you can then do "hide screen points_screen"
As to adding the heart, that uses the "add" screen element. So maybe your screen would look like:
Code:
screen points_screen():
text "[player_points]" align(0.0, 0.0)
add "heart_image" anchor(0.0, 0.0) pos(100,0)
This adds the image "heart_omage" such that it's top left corner is 100 pixels from the left edge of the screen, and its top edge is at the top of the screen. (The idea being to put it to the right of the points text)
You can use conditionals in screens too:
Code:
screen points_screen():
text "[player_points]" align(0.0, 0.0)
if player_points < 10:
add "small_heart_image" anchor(0.0, 0.0) pos(100,0)
else
add "big_heart_image" anchor(0.0, 0.0) pos(100,0)
Screen language is documented here:
You must be registered to see the links
This is a reference, not a tutorial (as is true for most Ren'py documentation pages) but will describe the various elements you can use in a screen.
And, yes, reverse-engineering how other games do things is a good way to learn Ren'py's capabilities.