Forum Archive

My RPG/Help/suggestions

reefboy1

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

ccc

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')
reefboy1

Thanks! :)

reefboy1

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)

'''

reefboy1

Oops
There is a glitch

reefboy1

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)
reefboy1

Uuggggghhhh never mind

reefboy1

My update can be found here

ccc

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.

reefboy1

Ok sorry

ccc

There is nothing to be sorry about... This is how we all learn.