Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
My RPG/Help/suggestions
-
Ok so this is my first time actually trying to TRY to do something in Python and I am going to need some suggestions . Also feel free to add code and post.
My code:#coding: utf-8 import sound import speech print(' ö ') print('-|-') print('| |') op = raw_input(' ') if op == 'shoot': print(' • ') print(' ') print(' |^|') print(' | | ') print(' | |)___') print(' \_____|') sound.play_effect('Laser_6')
Thanks
-
It looks good to me. You could also use
triple quoted strings
to store each of your graphics into a variable that holds a multiline string. That way whenever your rpg needs a guy, you can just write:print(guy)
.#coding: utf-8 import sound guy = ''' ö -|- | |''' gun = ''' • |^| | | | |)___ \_____|''' print(guy) op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6')
-
Thanks! :)
-
Ok I've come out with a new update with some graphical improvements and Ingame improvements including some fonts. Here is the update:
'''Python
#coding: utf-8
import sound
import speech
import console
rate=.1
lang='en-US'
console.set_font('Futura-CondensedExtraBold')
print('say shoot')
console.set_font('Cousine-Bold')
d = raw_input('Enter a number 1-3')
if d == '1':
print(' ö')
print(' -|-')
print(' | |')
gun = '''
•|^| | | | |)___ \_____|''' op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6') speech.say('Fireing Sir',lang,rate)
elif d == '2':
console.set_font('Cousine-Bold')
print(' ö ')
print('-|-')
print('| |')
gun = '''
•|^| | | | |)___ \_____|''' op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6') speech.say('Fireing Sir',lang,rate)
elif d == '3':
rate=.1 lang='en-US' console.set_font('Copperplate') guy = ''' ö -|- | |''' console.set_font('Cousine-Bold') gun = ''' • |^| | | | |)___ \_____|''' print(guy) op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6') speech.say('Fireing Sir',lang,rate)
'''
-
Oops
There is a glitch -
Here is the correct code:
#coding: utf-8
import sound
import speech
import console
rate=.1
lang='en-US'
console.set_font('Futura-CondensedExtraBold')
print('say shoot')
console.set_font('Cousine-Bold')
d = raw_input('Enter a number 1-3')
if d == '1':
print(' ö')
print(' -|-')
print(' | |')
gun = '''
•|^| | | | |)___ \_____|''' op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6') speech.say('Fireing Sir',lang,rate)
elif d == '2':
console.set_font('Cousine-Bold')
print(' ö ')
print('-|-')
print('| |')
gun = '''
•|^| | | | |)___ \_____|''' op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6') speech.say('Fireing Sir',lang,rate)
elif d == '3':
rate=.1 lang='en-US' console.set_font('Copperplate') guy = ''' ö -|- | |''' console.set_font('Cousine-Bold') gun = ''' • |^| | | | |)___ \_____|''' print(guy) op = raw_input(' ') if op == 'shoot': print(gun) sound.play_effect('Laser_6') speech.say('Fireing Sir',lang,rate)
-
Uuggggghhhh never mind
-
My update can be found here
-
To format your code for this forum, follow these instructions: http://omz-forums.appspot.com/pythonista/post/5282237671014400
Try to edit a previous post instead of creating a new one each time.
Pay special attention to: Make sure there are
no space characters before or after the backticks
. That appears to be the problem with your posts above. -
Ok sorry
-
There is nothing to be sorry about... This is how we all learn.