Something like cheat codes

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
User avatar
Posts: 339
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia

Something like cheat codes

#1 Post by Andredron » Thu May 16, 2019 2:54 am

Image ... heat.jpg

Link to the archive with the project ... 8.html?m=1

Code: Select all

init python:

    money = 100
    # stroke
    style.default.outlines = [(2, "# 0008", 0, 0), (1, "# 0008", 0, 0)]

    # action for entering and checking cheats
    def call_input ():
        code = input ("Enter the code:")
        if code == "1234":
            global money
            money + = 100
            message ("You conjured 100 money.")
        elif code is None:
            message ("You pressed cancel.")
            message ("Password is incorrect.")
    CallInput = renpy.curry (call_input)

#this screen is waiting for tabbing
screen cheat:
    key "K_TAB" action CallInput ()
    # denyuzhek indicator
    frame align (.95, .05) background "# 0008":
        text "$ [money]" color "# dd4" size 48

# The game starts here.
label start:
    scene bg
    show neko with dissolve
    # show the screen that catches the cheat code button
    show screen cheat
    "Press TAB to enter the cheat code. And enter" 1234 "."
    "Game over."

I know, I'm writing terribly in English.

I'm writing a Renpy textbook (in Russian). Update 22.06.18

Honest Critique

Post Reply

Who is online

Users browsing this forum: No registered users