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
Message
Author
User avatar
Andredron
Miko-Class Veteran
Posts: 714
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Something like cheat codes

#1 Post by Andredron »

Image
https://4.bp.blogspot.com/-F2podp4Ypdg ... heat.jpg

Link to the archive with the project

http://renpyfordummies.blogspot.com/201 ... 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.")
        else:
            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."
    return


Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]