I'm having trouble with the code. I started to write the game and wanted to start with the coding for asking the player for his/her name. I think I pasted it into the wrong lines, it doesn't work. Can you tell me where I failed? Sorry for my bad english.
This is my code:
Code: Select all
# You can place the script of your game in this file.
# Here we define the backgrounds that are used.
image bg intro_bg = "Intro_0.png"
# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
# Declare characters used by this game.
define s = Character('Saki', color="#5F04B4")
define o = Character('Otome', color="#000000")
# The game starts here.
label start:
define player_first_name = ""
define player_last_name = ""
define player_name = ""
"What's your given name?"
# The phrase in the brackets is the text that the game will display to prompt
# the player to enter the name they've chosen.
$ player_name = renpy.input("What is your given name?") or "Me" #check for no input in name is done here
$ player_name = player_name.strip() # it may interfere with the splitting code if it strips space chars mid-string, need to check on that. If it's a problem use .rstrip() instead.
python:
if player_name == "":
$ player_name="Shuji" # If the player can't be bothered to choose a name, then we choose a suitable one for them:
# Now the other characters in the game can greet the player.
"Let's begin the adventure [player_name]!"
return