Ren'Py need help on heart/Penis meter

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,118
is there a way to change this so that you have to keep pressing the spacebar?
heart/Penis meter for renpy game from My Cute Roommate

init code:
Python:
init:
    $ womanbar = False
    $ womanbar_stop = False
    $ penisbar = True
    $ penpoint_stop = 15

init python:
    timer_no_button = False
    penistimerst = False
video setting:
Python:
image your_video_name = Movie(play="Your_video")
code after start label:
Python:
label start:
    e "You've created a new Ren'Py game."
    $ penistimeron = True
    $ penpoint = 4
    $ n = 0.02
    $ penistimer = 20
    $ womanbar = True
    $ timerjump = "cous_massage_fuck_ass_cum"
    show screen penistimer
    show your_video_name
label cous_massage_fuck_ass_cum:
    e "Once you add a story, pictures, and music, you can release it to the world!"
screen:
Python:
screen penistimer(penisxalign=1.0):

    if penistimeron:
        timer 0.1 repeat True action If(penpoint < penistimer, true=SetVariable('penpoint', penpoint + n), false = [Hide('penistimer'), Jump(timerjump)])
    else:
        timer 0.1 repeat True action If(penpoint > 0, true = SetVariable('penpoint', penpoint - n), false = SetVariable('penpoint',0))

    if penistimerst:
        timer 0.1 repeat True action If(penpoint >= penistimerst, true = [Hide('penistimer'), Jump(timerjump)], false = NullAction())

    if penisbar:
        vbar value StaticValue(penpoint, penistimer):
            align (penisxalign, 0)
            maximum (200, 500)
            left_bar "ind_empty"
            right_bar "ind_full"
            thumb None
            thumb_shadow None

    if womanbar:
        vbar value StaticValue(penpoint, penistimer):
            align (0.0, 0)
            maximum (200, 500)
            left_bar "indg_empty"
            right_bar "indg_full"
    else:
        if womanbar_stop:
            timer 0.1 repeat True action If(penpoint_stop < 18, true = SetVariable('penpoint_stop', penpoint_stop + n), false = SetVariable('penpoint_stop',15))
            vbar value StaticValue(penpoint_stop, penistimer):
                align (0.0, 0)
                maximum (200, 500)
                left_bar "indg_empty"
                right_bar "indg_full"

    if penpoint > 10 and not timer_no_button:
        imagebutton:
            if penisxalign == 0.0:
                pos (58,29)
            else:
                pos (1777,29)
            idle "images/Buttons/penis_timer_cum_button.png"
            hover im.MatrixColor("images/Buttons/penis_timer_cum_button.png",im.matrix.brightness(0.10))
            action Hide('penistimer'), Jump(timerjump)


screen w_bar(var=1, maxvar=24):
    vbar value StaticValue(var, maxvar):
        align (0.0, 0)
        maximum (200, 500)
        left_bar "indg_empty"
        right_bar "indg_full"
image goes into the image folder
one image goes into images/button
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,118
I have figure it out by doing this

Python:
screen penistimer(penisxalign=1.0):
    key "K_l" action SetVariable('penpoint', penpoint + 1)

    if penistimeron:
        timer 0.1 repeat True action If(penpoint < penistimer, true=SetVariable('penpoint', penpoint + n), false = [Hide('penistimer'), Jump(timerjump)])
    else:
        timer 0.1 repeat True action If(penpoint > 0, true = SetVariable('penpoint', penpoint - n), false = SetVariable('penpoint',0))

    if penistimerst:
        timer 0.1 repeat True action If(penpoint >= penistimerst, true = [Hide('penistimer'), Jump(timerjump)], false = NullAction())

    if penisbar:
        vbar value StaticValue(penpoint, penistimer):
            align (penisxalign, 0)
            maximum (200, 500)
            left_bar "ind_empty"
            right_bar "ind_full"
            thumb None
            thumb_shadow None


    if penpoint > 10 and not timer_no_button:
        imagebutton:
            if penisxalign == 0.0:
                pos (58,29)
            else:
                pos (1777,29)
            idle "images/Buttons/penis_timer_cum_button.png"
            hover im.MatrixColor("images/Buttons/penis_timer_cum_button.png",im.matrix.brightness(0.10))
            action Hide('penistimer'), Jump(timerjump)


screen penistimer2(penisxalign=1.0):
    key "K_k" action SetVariable('penpoint2', penpoint2 + 1)

    if penistimeron:
        timer 0.1 repeat True action If(penpoint2 < penistimer, true=SetVariable('penpoint2', penpoint2 + n), false = [Hide('penistimer'), Jump(timerjump)])
    else:
        timer 0.1 repeat True action If(penpoint2 > 0, true = SetVariable('penpoint2', penpoint2 - n), false = SetVariable('penpoint2',0))

    if penistimerst:
        timer 0.1 repeat True action If(penpoint2 >= penistimerst, true = [Hide('penistimer'), Jump(timerjump)], false = NullAction())


    if womanbar:
        vbar value StaticValue(penpoint2, penistimer):
            align (0.0, 0)
            maximum (200, 500)
            left_bar "indg_empty"
            right_bar "indg_full"
    else:
        if womanbar_stop:
            timer 0.1 repeat True action If(penpoint2_stop < 18, true = SetVariable('penpoint2_stop', penpoint2_stop + n), false = SetVariable('penpoint2_stop',15))
            vbar value StaticValue(penpoint2_stop, penistimer):
                align (0.0, 0)
                maximum (200, 500)
                left_bar "indg_empty"
                right_bar "indg_full"

    if penpoint2 > 10 and not timer_no_button:
        imagebutton:
            if penisxalign == 0.0:
                pos (58,29)
            else:
                pos (1777,29)
            idle "images/Buttons/penis_timer_cum_button.png"
            hover im.MatrixColor("images/Buttons/penis_timer_cum_button.png",im.matrix.brightness(0.10))
            action Hide('penistimer'), Jump(timerjump)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,170
14,885
I don't get the intent of the original code.

The timer increase when penistimeron is True, and decrease else. But the value is defined in a label and I didn't see in the screen a place where it is changed. What mean that the bar will increase by itself, and will also never decrease.
It shouldn't be done like that. Either the timer are useless, or the fact to press a key should somehow change the value of penistimeron. But the way this code is done don't at all feel right.

Normally this kind of thing is wrote like that:
Python:
screen penistimer( step=0.1, goal=10 ):
    # Increase the counter when a key is pressed
    key "K_space" action SetVariable('penpoint', penpoint + 1)

    # Always decrease the counter, this force the player to press the key many times.
    # And return if the counter goes below the decreasing step.
    timer 0.1 repeat True action If(penpoint > step, SetVariable('penpoint', penpoint - step), Return( False ) )

    # Wait for a winner, returning if you got one, doing nothing else.
    timer 0.1 repeat True action If( penpoint >= goal, Return( True ), NullAction() )

    # Here display the counter the way you want

label whatever:
    $ penpoint = 4
    call screen penistimer( step=0.2, goal=20 )
    if _return:
        "Congratulation, you won."
    else:
        "We found a looser."
 
  • Like
Reactions: rayminator

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,118
the screen have shown like this so using call will not work

like this
Untitled-1.png
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,118
I don't get the intent of the original code.

The timer increase when penistimeron is True, and decrease else. But the value is defined in a label and I didn't see in the screen a place where it is changed. What mean that the bar will increase by itself, and will also never decrease.
It shouldn't be done like that. Either the timer are useless, or the fact to press a key should somehow change the value of penistimeron. But the way this code is done don't at all feel right.

Normally this kind of thing is wrote like that:
Python:
screen penistimer( step=0.1, goal=10 ):
    # Increase the counter when a key is pressed
    key "K_space" action SetVariable('penpoint', penpoint + 1)

    # Always decrease the counter, this force the player to press the key many times.
    # And return if the counter goes below the decreasing step.
    timer 0.1 repeat True action If(penpoint > step, SetVariable('penpoint', penpoint - step), Return( False ) )

    # Wait for a winner, returning if you got one, doing nothing else.
    timer 0.1 repeat True action If( penpoint >= goal, Return( True ), NullAction() )

    # Here display the counter the way you want

label whatever:
    $ penpoint = 4
    call screen penistimer( step=0.2, goal=20 )
    if _return:
        "Congratulation, you won."
    else:
        "We found a looser."
thanks just tried it and it works
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,118
update now that I have most of working with show whatever movie but want it be like this

Python:
play movie "video/extra/cous_massage_fuck_pussy.webm" loop
    show movie
    $ renpy.show_screen("penistimer")
    $ penistimeron = True
    $ penpoint = 4
    $ n = 0.02
    $ penistimer = 20
    $ womanbar_stop = True
    $ penisbar = True
    $ timerjump = "cuminside"
    show screen penistimer
    $ renpy.pause(5.0)
without using this image eileen movie = Movie(play="video/extra/cous_massage_fuck_pussy.webm")