Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LetsMakeAGame:
- def __init__(self, name, by, desc, created, updated, version):
- self.name = name
- self.by = by
- self.desc = desc
- self.created = created
- self.updated = updated
- self.version = version
- def to_string(self):
- res = "Let's make a game!\n"
- res += " name:" + str(self.name) + "\n"
- res += " by:" + str(self.by) + "\n"
- res += " desc:" + str(self.desc) + "\n"
- res += " created:" + str(self.created) + "\n"
- res += " updated:" + str(self.updated) + "\n"
- res += " version:" + str(self.version) + "\n"
- return str(res)
- class Settings:
- def __init__(self, background, building_cost_increase, building_cost_refund, spritesheet, stylesheet):
- self.background = background
- self.building_cost_increase = building_cost_increase
- self.building_cost_refund = building_cost_refund
- self.spritesheet = spritesheet
- self.stylesheet = stylesheet
- def to_string(self):
- res = "Settings\n"
- res += " background:" + str(self.background) + "\n"
- res += " building cost increase:" + str(self.building_cost_increase) + "\n"
- res += " building cost refund:" + str(self.building_cost_refund) + "\n"
- res += " spritesheet:" + str(self.spritesheet) + "\n"
- res += " stylesheet:" + str(self.stylesheet) + "\n"
- return str(res)
- class CSS:
- def __init__(self, code):
- self.code = code
- def to_string(self):
- res = "CSS\n"
- res += " " + str(self.code) + "\n"
- return str(res)
- class Layout:
- def __init__(self, code):
- self.code = code
- def to_string(self):
- res = "Layout\n"
- res += " " + str(self.code) + "\n"
- return str(res)
- class Buttons:
- def __init__(self, buttons):
- self.buttons = buttons
- def to_string(self):
- res = "Buttons\n"
- res += " " + str(self.buttons) + "\n"
- return str(res)
- class ButtonObject:
- def __init__(self, label, name, desc, on_click, icon, text, class_name, icon_class, tooltip_origin, tooltip_class):
- self.label = label
- self.name = name
- self.desc = desc
- self.on_click = on_click
- self.icon = icon
- self.text = text
- self.class_name = class_name
- self.icon_class = icon_class
- self.tooltip_origin = tooltip_origin
- self.tooltip_class = tooltip_class
- def to_string(self):
- res = "*" + str(self.label) + "\n"
- res += " name:" + str(self.name) + "\n"
- res += " desc:" + str(self.desc) + "\n"
- res += " on click:" + str(self.on_click) + "\n"
- res += " icon:" + str(self.icon) + "\n"
- if self.text == "no text":
- res += " " + str(self.text) + "\n"
- else:
- res += " text:" + str(self.text) + "\n"
- res += " class:" + str(self.class_name) + "\n"
- res += " icon class:" + str(self.icon_class) + "\n"
- res += " tooltip origin:" + str(self.tooltip_origin) + "\n"
- res += " tooltip class:" + str(self.tooltip_class) + "\n"
- return str(res)
- class Resources:
- def __init__(self, resources):
- self.resources = resources
- def to_string(self):
- res = "Resources\n"
- res += " " + str(self.resources) + "\n"
- return str(res)
- class ResourceObject:
- def __init__(self, label, name, desc, icon, on_tick, class_name, additional_desc):
- self.label = label
- self.name = name
- self.desc = desc
- self.icon = icon
- self.on_tick = on_tick
- self.class_name = class_name
- self.additional_desc = additional_desc
- def to_string(self):
- res = "*" + str(self.label) + "\n"
- res += " name:" + str(self.name) + "\n"
- res += " desc:" + str(self.desc) + "\n"
- res += " icon:" + str(self.icon) + "\n"
- res += " on tick:" + str(self.on_tick) + "\n"
- res += " class:" + str(self.class_name) + "\n"
- res += str(self.additional_desc) + "\n"
- return str(res)
- class Shinies:
- def __init__(self, shinies):
- self.shinies = shinies
- def to_string(self):
- res = "Shinies\n"
- res += " " + str(self.shinies) + "\n"
- return str(res)
- class ShinyObject:
- def __init__(self, label, movement, frequency, frequency_variation, icon, class_name, on_click):
- self.label = label
- self.movement = movement
- self.frequency = frequency
- self.frequency_variation = frequency_variation
- self.icon = icon
- self.class_name = class_name
- self.on_click = on_click
- def to_string(self):
- res = "*" + str(self.label) + "\n"
- res += " movement:" + str(self.movement) + "\n"
- res += " frequency:" + str(self.frequency) + "\n"
- res += " frequency variation:" + str(self.frequency_variation) + "\n"
- res += " icon:" + str(self.icon) + "\n"
- res += " class:" + str(self.class_name) + "\n"
- res += " on click:" + str(self.on_click) + "\n"
- return str(res)
- class Buildings:
- def __init__(self, buildings):
- self.buildings = buildings
- def to_string(self):
- res = "Buildings\n"
- res += " " + str(self.buildings) + "\n"
- return str(res)
- class BuildingObject:
- def __init__(self, label, name, desc, icon, cost, on_tick, req):
- self.label = label
- self.name = name
- self.desc = desc
- self.icon = icon
- self.cost = cost
- self.on_tick = on_tick
- self.req = req
- def to_string(self):
- res = "*" + str(self.label) + "\n"
- res += " name:" + str(self.name) + "\n"
- res += " desc:" + str(self.desc) + "\n"
- res += " icon:" + str(self.icon) + "\n"
- res += " cost:" + str(self.cost) + "\n"
- res += " on tick:" + str(self.on_tick) + "\n"
- res += " req:" + str(self.req) + "\n"
- return str(res)
- class Upgrades:
- def __init__(self, upgrades):
- self.upgrades = upgrades
- def to_string(self):
- res = "Upgrades\n"
- res += " " + str(self.upgrades) + "\n"
- return str(res)
- class UpgradeObject:
- def __init__(self, label, name, desc, icon, cost, passive, req):
- self.label = label
- self.name = name
- self.desc = desc
- self.icon = icon
- self.cost = cost
- self.passive = passive
- self.req = req
- def to_string(self):
- res = "*" + str(self.label) + "\n"
- res += " name:" + str(self.name) + "\n"
- res += " desc:" + str(self.desc) + "\n"
- res += " icon:" + str(self.icon) + "\n"
- res += " cost:" + str(self.cost) + "\n"
- res += " passive:" + str(self.passive) + "\n"
- res += " req:" + str(self.req) + "\n"
- return str(res)
- class Achievements:
- def __init__(self, achievements):
- self.achievements = achievements
- def to_string(self):
- res = "Achievements\n"
- res += " " + str(self.achievements) + "\n"
- return str(res)
- class AchievementObject:
- def __init__(self, label, name, desc, req):
- self.label = label
- self.name = name
- self.desc = desc
- self.req = req
- def to_string(self):
- res = "*" + str(self.label) + "\n"
- res += " name:" + str(self.name) + "\n"
- res += " desc:" + str(self.desc) + "\n"
- res += " req:" + str(self.req) + "\n"
- return str(res)
- def main():
- IGM = ""
- print("You are now in the 'Let's make a game!' part")
- name = input("Please enter name of the game: ")
- by = input("Please enter your name: ")
- desc = input("Please enter some description: ")
- created = input("Please enter the date you create the game: ")
- updated = input("Please enter the datr you update the game: ")
- version = input("Please enter version of the game: ")
- lmag = LetsMakeAGame(name, by, desc, created, updated, version)
- IGM += lmag.to_string()
- print("You are now in the settings part")
- background = input("Please enter path of the background image file: ")
- building_cost_increase = input("Please enter building cost increase: ")
- building_cost_refund = input("Please enter building cost refund: ")
- spritesheet = input("Please enter spritesheet: ")
- stylesheet = input("Please enter stylesheet: ")
- settings = Settings(background, building_cost_increase, building_cost_refund, spritesheet, stylesheet)
- IGM += settings.to_string()
- print("You are now in the CSS part")
- print("Type y, Y or yes for yes")
- print("Type anything else for no")
- css_code_ask = input("Do you want to include CSS code?")
- if css_code_ask == "y" or css_code_ask == "Y" or css_code_ask == "yes":
- css_code = "" # initial value
- loc = int(input("How many lines of CSS code do you want?"))
- for i in range(loc):
- curr_line = input("Please enter your line of code: ")
- css_code += curr_line + "\n"
- print("Your current CSS code: ")
- print(css_code)
- css_part = CSS(css_code)
- IGM += css_part.to_string()
- else:
- css_code = "\n"
- IGM += css_code
- print("You are now in the layout part")
- print("Type y, Y or yes for yes")
- print("Type anything else for no")
- layout_code_ask = input("Do you want to include layout code?")
- if layout_code_ask == "y" or layout_code_ask == "Y" or layout_code_ask == "yes":
- layout_code = "" # initial value
- loc = int(input("How many lines of layout code do you want?"))
- for i in range(loc):
- curr_line = input("Please enter your line of code: ")
- layout_code += curr_line + "\n"
- print("Your current layout code: ")
- print(layout_code)
- layout_part = Layout(layout_code)
- IGM += layout_part.to_string()
- else:
- layout_code = "\n"
- IGM += layout_code
- print("You are now in the buttons part")
- btns = Buttons("")
- num_buttons = int(input("How many buttons do you want?"))
- for i in range(num_buttons):
- label = input("Please enter the label you want: ")
- name = input("Please enter name: ")
- desc = input("Please add description: ")
- on_click = ""
- num_on_click_lines = int(input("How many lines of code do you want for on click part of the button?"))
- for j in range(num_on_click_lines):
- curr_line = input("Please enter line of code: ")
- on_click += curr_line + "\n"
- print("Your current on click code: ")
- print(on_click)
- icon = input("Please enter link to the image to be used as the icon: ")
- text = input("Please enter text to be displayed: ")
- class_name = input("Please enter class: ")
- icon_class = input("Please enter icon class: ")
- tooltip_origin = input("Please enter tooltip origin: ")
- tooltip_class = input("Please enter tooltip class: ")
- button_obj = ButtonObject(label, name, desc, on_click, icon, text, class_name, icon_class, tooltip_origin, tooltip_class)
- btns.buttons += button_obj.to_string()
- IGM += btns.to_string()
- print("You are now in the resources part")
- resources_code = Resources("")
- num_resources = int(input("How many resources do you want?"))
- for i in range(num_resources):
- label = input("Please enter the label you want: ")
- name = input("Please enter name of resource: ")
- desc = input("Please enter description: ")
- icon = input("Please enter link to image file which is to be used as the icon: ")
- on_tick = ""
- num_on_tick_lines = int(input("How many lines of code do you want for on tick part of the resource?"))
- for j in range(num_on_tick_lines):
- curr_line = input("Please enter line of code: ")
- on_tick += curr_line + "\n"
- print("Your current on tick code: ")
- print(on_tick)
- class_name = input("Please enter class: ")
- additional_desc = ""
- additional_desc_lines = int(input("How many lines of code for additional description part do you want?"))
- for j in range(additional_desc_lines):
- curr_line = input("Please enter line of code: ")
- additional_desc += curr_line + "\n"
- print("Your current additional description code: ")
- print(additional_desc)
- res_obj = ResourceObject(label, name, desc, icon, on_tick, class_name, additional_desc)
- resources_code.resources += res_obj.to_string()
- IGM += resources_code.to_string()
- print("You are now in the shinies part")
- shinies_code = Shinies("")
- num_shinies = int(input("How many shinies do you want?"))
- for i in range(nun_shinies):
- label = input("Please enter the label you want: ")
- movement = input("Please enter movement: ")
- frequency = input("Please enter frequency: ")
- frequency_variation = input("Please enter frequency variation: ")
- icon = input("Please enter link to image file to be used as the icon: ")
- class_name = input("Please enter class: ")
- on_click = ""
- num_on_click_lines = int(input("How many lines of code do you want for on click part of the shiny?"))
- for j in range(num_on_click_lines):
- curr_line = input("Please enter line of code: ")
- on_click += curr_line + "\n"
- print("Your current on click code: ")
- print(on_click)
- shiny_obj = ShinyObject(label, movement, frequency, frequency_variation, icon, class_name, on_click)
- shinies_code.shinies += shiny_obj.to_string()
- IGM += shinies_code.to_string()
- print("You are now in the buildings part")
- buildings_code = Buildings("")
- num_buildings = int(input("How many buildings do you want?"))
- for i in range(num_buildings):
- label = input("Please enter the label you want: ")
- name = input("Please enter name: ")
- desc = input("Please enter description: ")
- icon = input("Please enter link to the image file to be used as the icon: ")
- cost = input("Please enter cost")
- on_tick = ""
- num_on_tick_lines = int(input("How many lines of code do you want for on tick part of the building?"))
- for j in range(num_on_tick_lines):
- curr_line = input("Please enter line of code: ")
- on_tick += curr_line + "\n"
- print("Your current on tick code: ")
- print(on_tick)
- req = input("Please enter requirements: ")
- building_obj = BuildingObject(label, name, desc, icon, cost, on_tick, req)
- buildings_code.buildings += building_obj.to_string()
- IGM += buildings_code.to_string()
- print("You are now in the upgrades part")
- upgrades_code = Upgrades("")
- num_upgrades = int(input("How many upgrades do you want?"))
- for i in range(num_upgrades):
- label = input("Please enter the label you want: ")
- name = input("Please enter name: ")
- desc = input("Please enter description: ")
- icon = input("Please enter link to the image file to be used as the icon: ")
- cost = input("Please enter cost: ")
- passive = input("Please enter passive: ")
- req = input("Please enter requirements: ")
- upgrade_obj = UpgradeObject(label, name, desc, icon, cost, passive, req)
- upgrades_code.upgrades += upgrade_obj.to_string()
- IGM += upgrades_code.to_string()
- print("You are now in the achievements part")
- achievements_code = Achievements("")
- num_achievements = int(input("How many achievements do you want?"))
- for i in range(num_achievements):
- label = input("Please enter the label you want: ")
- name = input("Please enter name: ")
- desc = input("Please enter description: ")
- req = input("Please enter requirements: ")
- achievement_obj = AchievementObject(label, name, desc, req)
- achievements_code.achievements += achievement_obj.to_string()
- IGM += achievements_code.to_string()
- print("Your Orteil Idle Game Maker code is as below.\n")
- print(IGM)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement