[Solved] Trying to make a clicker timed event you can't win

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Rabby
Newbie
Posts: 11
Joined: Tue Aug 24, 2021 3:29 pm
Contact:

[Solved] Trying to make a clicker timed event you can't win

#1 Post by Rabby »

I've been trying to code an event you can't win that stops when you stop clicking your mouse, similar to button mashing but clicking
Last edited by Rabby on Tue Jan 25, 2022 1:24 pm, edited 1 time in total.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: [question] Trying to make a clicker timed event you can't win

#2 Post by Per K Grok »

Rabby wrote: Mon Jan 24, 2022 1:37 pm I've been trying to code an event you can't win that stops when you stop clicking your mouse, similar to button mashing but clicking


You could do something like this.
In the code 'stoppoint' defines how fast you need to click to stay alive

Code: Select all

default stopfloat= 0.0
define stoppoint=0.3

screen mbmasher():
    text str(stopfloat)   ###  to se how fast you click, not necessary for the function
    key "mousedown_1" action SetVariable("stopfloat", 0)
    timer 0.02 action If(stopfloat>stoppoint, true=Jump("Lose"), false=SetVariable("stopfloat", stopfloat + 0.02)) repeat True

label start:
    "Start"
    call screen mbmasher

label Lose:
    "You lose"
    $ stopfloat=0.0
    jump start

Rabby
Newbie
Posts: 11
Joined: Tue Aug 24, 2021 3:29 pm
Contact:

Re: [question] Trying to make a clicker timed event you can't win

#3 Post by Rabby »

I'll give it a shot thanks!

Rabby
Newbie
Posts: 11
Joined: Tue Aug 24, 2021 3:29 pm
Contact:

Re: [question] Trying to make a clicker timed event you can't win

#4 Post by Rabby »

It's having an issue of stop float being given a default twice

Post Reply

Who is online

Users browsing this forum: No registered users