Share your repls and programming experiences

← Back to all posts
BETA High School RPG
MaciahLawson (32)

I have created this BETA High School game. Its made out of python. This took me an hour and a half just for this code.

UPVOTE IF U LIKE IT
ONLY THE JOCK AND THE NERD WORK CURRENTLY
THIS IS A LITTLE SNIPPET OF THE ENTIRE CODE AND PLEASE DO NOT STEAL THIS CODE AND MODIFY IT

Comments
hotnewtop
noway15 (97)

No offense but there's a lot of if's and that kind of takes up a lot of space. I mean you could always use the class attribute and write the entire story in that from that specific character's POV in order to save coding space. This game isn't too bad though.

codeninja135 (35)

@noway15 They can also use loops and definitions

noway15 (97)

@codeninja135 true but classes are better, take up less space, and each class can be personalized to fit its traits.

codeninja135 (35)

@noway15 true, maybe mix them both together anyway bc classes already use definitions, just need loops

MaciahLawson (32)

@codeninja135 Ok, thanks for the advice! :D.

Its a beta.

noway15 (97)

@codeninja135 not really they use functions, not loops.

codeninja135 (35)

@noway15 I meant put the class functions inside a loop

noway15 (97)

@codeninja135 impossible. The class functions are part of the class, so they must be accessed through the class. Also why would you put the class functions in a loop? This means that you would get the same functions over and over and over again. -_-

codeninja135 (35)

@noway15

class hello:
  def hi():
    return "hi"

for i in range(5):
  hello.hi()
noway15 (97)

@codeninja135 true but in this case it would be like:

class nerd:
  def __init__(self,health,pop,grades,strength)
    self.health = health
    #popularity
    self.pop = pop
    self.grades = grades
    self.strength = strength
  def firstchoice(self):
    choice = input("Will you go to: 1. First Period, 2. Second Period, 3. Thrid Period, or 4. Lunch?")
    if choice.lower() == "1":
      print("You went to first period.")
etc.

also you're forgetting the most important part of the class, the __init__() function -_-