Ok, so I'm a complete nooby when it comes to programming. What little I have learnt is from reading through a book on python once or twice.
I have been improving over the years, but my knowledge is very small.
I am attemping to make a very simple astronaut text game, comprising of a timeframe 1957-1972.
You play an astronaut, you have certain skills and aptitudes and you can do various action to A) improve these and B) get your ass in the driving seat of a capsule.
Currently it is in the total theoretical phase (only basic menu items have been coded).
This is
NOT one of those 'I'm going to make the most epic game evar and cant program'. I accept my limitations and am using what I know to make a game for personal fun
and any ideas anyone has or can offer would help, coding or not.
My primary concerns at the moment are:
Organising the various choices to do. So far there is: rest, practice, socialise end turn (I plan for at least 4 more).
Rest would rest, raising moral slightly which will make you less likely to burn out. Practice will be split into the skills, Capsule, EVA, LEM, Docking, Endurance. Socialise would raise some 'visibility' modifier, which would raise your chance to be chosen for a mission not based on skill, but partially because of
who you know.
End turn would move to the calculation phase.
The 'mission' phase will be the majority of the coding. If anyone has played BARIS (See my LP in 'others' forum), you will imagine already how the mission will go.
Missions would be run like this:
what componants does mission have? launch=yes, orbital insertion=yes, eva=no,docking=no. etc etc
Launch stage, roll for rocket safety = success or failure? roll for catastrophic failure?
Orbital insertion stage, roll for capsule safety + pilot skill = success or failure? roll for catastrophic failure?
and so on.
The development of the space agency and when missions are run I am undecided whether to make it historical (historic launch times) or write some ramdomised code.
Example = usa gets 100 money each turn, soviets get 75, when money reaches 500 a semi random mission is rolled and initiated? (one which is needed) also random events may increase/decrease this money.
The goal will be getting yourself ready and in position compared to npc astronauts to be chosen for the mission, based on your avaliability (maybe other decent ones washed out of training/got injured etc) or your proficiency for the mission.
Code would be something along the line of: semi random mission roll - sub orbital manned, need crew?=yes, required astronaut 1skill=capsule, required astronaut2 skill= docking. pick one which has the highest of both of these. (this code I will have to research, I have forgotten how to do 'lists')
Anyway as I said any help is welcome in coding or ideas!
Heres what I have so far, Ill update as it comes along. (yes it is probably the most disorganised code you have ever seen!)
import random
import time
##types of activity##
#Launch
#Orbital Insertion Burn
#Earth Orbital Activities
#Orbital Docking
#Equipment power-up
#LEM descent
#LEM testing thrusters
#Orbital EVA
#Duration A
#Duration B
#Duration C
#Duration D
#Duration E
#Duration F
#Trans-Lunar injection
#Mid-Course Correction Burn
#Lunar Photography
#Lunar Orbital Activities
#Re-entry
#Recovery
##type end##
start = ''
print 'hello what is your name?'
name = raw_input()
time.sleep(1)
print 'your name is ' + name
while start > 5:
time.sleep(2)
print 'would you like to be a Cosmonaut or Astronaut?'
nationchoice = raw_input()
if nationchoice == 'Cosmonaut':
start = 1
elif nationchoice == 'Astronaut':
start = 1
else:
start = 10
print 'Choose Cosmonaut or Astronaut please.'
cosmonautmoney = 75
astronautmoney = 100
cosmonautstageone = 'Vostok'
astronautstageone = 'Mercury'
##BEGINNING OF ROSTERS##
##mercury 7##
Shirra = [2, 1 , 1, 1, 1, 100]
Glenn = [1, 1, 1, 0, 1, 100]
Grissom = [3, 1, 1, 1, 1, 100]
Cooper = [2, 1, 1, 1, 3, 100]
Shepard = [1, 1 ,1 ,1 ,2 , 100]
Slayton = [4, 1, 1, 0, 1, 100]
Carpenter = [1, 0, 1, 0, 2, 100]
Astronauts = [Shirra, Glenn, Grissom, Cooper, Shepard, Slayton, Carpenter] + [name]
##Vostok crew##
Gagarin = []
Titov = []
Nikolayev = []
Popovich = []
Bykovsky = []
Tereshkova = []
Cosmonauts = [Gagarin, Titov, Nikolayev, Popovich, Bykovsky, Tereshkova]
##END OF ROSTERS##
intro = 1
c = ''
l = ''
e = ''
d = ''
en = ''
m = ''
if nationchoice == 'Cosmonaut':
campaign = 1
date = 1957
qt =1
if nationchoice == 'Astronaut':
campaign = 2
date = 1957
qt = 1
while intro == 1:
print 'you are a ' + nationchoice + '.'
time.sleep(1)
print 'The date is ' + str(date)
time.sleep(1)
print 'Your goal is to have a successful career in the space program, good luck!'
time.sleep(2)
##generation##
c = random.randint(0, 10)
l = random.randint(0, 5)
e = random.randint(0, 5)
d = random.randint(0, 5)
en = random.randint(0, 5)
m = random.randint(0, 100)
vis = 5
intro = 0
##classes##
class mission:
def __init__(self, program, number, year, quarter, OIB):
self.program = program
self.number = number
self.year = year
self.quarter = quarter
self.OIB = OIB
sputnik4 = mission('Sputnik', '4', 1960, 2, 'True')
sputnik4b = mission('Sputnik', '4b', 1960, 3, 'True')
sputnik5 = mission('Sputnik', '5', 1960, 3, 'True')
sputnik6 = mission('Sputnik', '6', 1960, 4, 'True')
sputnik7 = mission('Sputnik', '7', 1960, 4, 'True')
sputnik9 = mission('Sputnik', '9', 1961, 1, 'True')
sputnik10 = mission('Sputnik', '10', 1961, 1, 'True')
s4year = sputnik4.year
s4qt = sputnik4.quarter
##menu##
choice = '0'
alive = 1
while alive == 1:
while choice != 5:
print 'The date is ' + str(date) + ', Quarter ' + str(qt)
print 'What would you like to do?\n'
time.sleep(2)
print 'You can:\n1.REST\n2.PRACTICE\n3.SOCIALISE\n4.VIEW SKILLS\n10.NEXT TURN'
time.sleep(1)
print 'Enter your choice.'
choice = raw_input()
##viewskills##
if choice == str(4):
print 'Your skills are\n'
print 'Cap: ' + str(c)
print 'LEM: ' + str(l)
print 'EVA: ' + str(e)
print 'Doc: ' + str(d)
print 'End: ' + str(en)
print 'Mor: ' + str(m)
raw_input('Press ENTER to close')
##rest##
if choice == str(1):
increase = random.randint(0, 5)
print 'moral increased by ' + str(increase) + ' to ' + str(m)
time.sleep(2)
choice = 5
##Socialise##
if choice == str(3):
increase = random.randint (0, 5)
print 'You go to a local party, increasing your visibility to the elite by ' + str(increase) + ' making it ' + str(vis)
time.sleep(2)
choice = 5
##practice##
if choice == str(2):
choice = '5'
pchoice = ''
while pchoice != 'o':
print 'What would you like to practice?'
print '[C]apsule\n[L]EM\n[E]VA\n[D]ocking\nE[n]durance\nN[o]ne'
pchoice = raw_input()
if pchoice == 'c':
c = c + random.randint(0, 5)
print 'your practice increased your Capsule skill to ' + str(c)
pchoice = 'o'
choice = 5
if pchoice == 'l':
l = l + random.randint(0, 5)
print 'your practice increased your LEM skill to ' + str(l)
pchoice = 'o'
choice = 5
if pchoice == 'e':
e = e + random.randint(0, 5)
print 'your practice increased your EVA skill to ' + str(e)
pchoice = 'o'
choice = 5
if pchoice == 'd':
d = d + random.randint(0, 5)
print 'your practice increased your Docking skill to ' + str(d)
pchoice = 'o'
choice = 5
if pchoice == 'n':
n = c + random.randint(0, 5)
print 'your practice increased your Endurance skill to ' + str(n)
pchoice = 'o'
choice = 5
time.sleep(1)
print 'Your skills are\n'
print 'Cap: ' + str(c)
print 'LEM: ' + str(l)
print 'EVA: ' + str(e)
print 'Doc: ' + str(d)
print 'End: ' + str(en)
print 'Mor: ' + str(m)
raw_input('Press ENTER to close')
#if s4year == date:
#if s4qt == qt:
##sputnik4 mission here##
##end turn calc##
if qt == 4:
date = date +1
qt = 0
qt = qt + 1
choice = ''
##working - next to do - end turn calc/competition astronauts + space program progression##
##revise skill increase to include the incriment in which it increased by##