I know I've seen various references, and hints on how to do this but so far I have not found the code I'm looking for. I'm having problems adding to my current code which has the default player set to PC. But what I'd like to do is add in addition to the pc, a menu that ask u, "Male/Female" when u enter the game, then depending on which u choose your character will be given the correct icon. I see lots of games with this, but I can't see their code.
Any suggestions? Code? Tutorial? Demo, where I can see how the code is written?
LJR
ID:179797
Nov 3 2001, 5:53 pm
|
|
In response to LordJR
|
|
Bravo!!!! With an attitude and initiative like that, I'm sure you'll go far. Here's a tip on efficiency:
if (src.gender == "female") src.icon = 'pc-girl.dmi' else src.icon = 'pc.dmi' will do the exact same thing as your code, but it is one line shorter! |
---------------------------------------
mob/Login()
usr.name = input("What is your name?") as text // text prompt
usr.gender = input("What is your gender?") in list("male","female")
if (usr.gender == "male") icon = 'pc.dmi'
else if (usr.gender == "female") icon = 'pc-girl.dmi'
else icon = 'pc.dmi'
return ..()
---------------------------------------
LJR
Creator of the RPG, "Kemet"