Skip to main content

Posts

Showing posts from November, 2022

Item() rundown

 The item() class holds the information of the item and also runs the item effect when it gets used. Constructor def __init__ ( self , command , name , cost , usage): self .effect = command self .name = name self .cost = cost self .usage = usage The effect holds the string name of the effect for the item,  usage holds the value of the Effect . The rest are self-explanatory. EffectHandler() def effectHandler ( self , user: PlayableCharacter , equip= True ): #learned how to specify type of parameter. if equip: if self .effect == "Def" : user.defense = user.defense + self .usage elif self .effect == "AtkPhy" or self .effect == "AtkMag" : user.attack = user.attack + self .usage else : if self .effect == "hp" : user = self .healing(user) return user This handles the effects of the item when it is used. If equip is true then it will check for the equip...

Ready for lift off! With top down desgin!

With my flow charts and my corrected UML in hand, I went on in to create all the functions with default returns and values to get myself set up. The reason I've done this is that I want to practice top design. I heard about it from my Java Programing professor and thought to implement it here just to see what it's like to break down problems into smaller steps beforehand and set up a framework so that it's easy to test things. So let's dive into it!     First things first, I created a monster object called "thatMonster" to use for testing purposes. It will be removed later down the line. Then I followed up with an outline in the main line of what methods will be called. # Main Line Commands inputAndCheck( "how would you like to boot? 0 New game or integer of save you are booting" , [ 0 ]) bootSave(currentAwnser) input ( type (Lori.level)) generateCharacters() os.system( "cls" ) input ( "we made it!!!" ) if chapter == 0 : input ...

Flow Charts are Born

Flow charts weren't that difficult to make. I honestly already had a decent idea of how my program would run, so this was really taking what was on my mind and putting it into a graphic. For those who don't know, I'm using a common key for software design for all of the flow charts: Source:  https://www.zenflowchart.com/flowchart-symbols First I have the simplest of my flow charts: theInstaller.py Flow chart. Then I made the Flow chart for theMain.py: Finally, I decided to include 2 flow charts for the important subprocess in the game: Explore() and runCombat(). For all of these, I used color codes to help subdivide the pieces of the code into their smaller loops or different paths. I'll be using these flow charts a lot to point out where exactly I'm at in the game as I go along with this blog.

UML Correction

 I recently showed my project to my Java Programing teacher and she told me that UMLs are only for classes, and the process on which those classes and methods are called is shown via flow charts. So I've made a new UML showing the classes and sub-classes and will begin working on the flow chart soon.  

From Paper to CSV

After some hard work, I've successfully added all the data from my design papers to theInstaller.py so it can create all the CSVs I need for the game. Here is a gif of the theInstaller.py in action!!!     As you may see I've reorganized the files a bit and will be removing the original unedited files from future commits just to prevent confusion. 

Shifting the OG into Object Oriented

With my UML in hand, I'm almost ready to begin the process of actually building the program, but first I wanted to take the code I had and change it to incorporate our new object-oriented plan. To do this I eliminated all global variables that shouldn't be in the theMain.py and used the new class Character and its subclasses instead. import csv from Character import Character from Monster import Monster from PlayableCharacter import PlayableCharacter import os # Variables currentAwnser = 0 x = 0 y = 0 z = 0 chapter = 0 Lori = PlayableCharacter( "Lori" ) Lauren = PlayableCharacter( "Lauren" ) # Functions def inputAndCheck (question , validAwnsers): # validAwnsers must be a list global currentAwnser awnserString = input (question) validaty = False convertedAwnser = 0 awnserFlag = False try : int (awnserString) validaty = True except ValueError : pass if validaty == False : inputAndCheck(question , validAwnsers) ...

UML Diagram and Object Oriented Programing.

Currently, the game uses only global variables and the methods in theMain.py to open and load data. It's become cumbersome to constantly call on the global variables for all my methods and I've realized that I'll be limited in the number of monsters I have if I only use global variables for everything. So this has led me to decide to shift to using Object-oriented programing to run my game. Thus I've prepared a UML diagram to show you all my classes, and subclasses, as well as their interactions, methods, and variables.      theMain.py will function as my main line where all classes and methods will be called as well as have some very important functions built into it. That's they it is connected to almost all the other classes. It'll take care of exploration, descriptions, story tracking, starting the game, ending the game, encounter rates, and gold.      GameMenu will be treated as a static class that has information displayed for the game menu as well as...

Game Design

While the code hasn't gotten that far. The design of the game is basically complete at this point. it's all written down on notes I've scribbled on sheets of paper. I'll go over all of it here. Over the course of this project, I'll be implementing these designs. The game is a classic RPG so making basic stats and level increments for all my characters and monsters was important.      These next few pictures show the level-up maps for all four playable characters: Lori, Lauren, Marcus, and Julius. Every character has a resource for their abilities and 4 abilities. Some abilities require the resource to be used others don't. The level-ups only go to 9, after level 9 the 10+ plus line shows the stat increase they get every level after the ninth. I haven't figured out how much experience is required for level-ups late because I want to test out different numbers and see what works best once the game is complete. I'll do a bigger breakdown of each character o...

The Original Code

 As I said in the introduction, I'd already worked on this project a bit before I started this blog. Today I imported my code and files into PyCharm. As of now, all this code does is prompt the user for the save file to load and then it boots the game. the only save file available at the moment is the newGame.csv which will be the default file for booting the game. To do this I had to make a selection handler to ensure that incorrect inputs won't crash the game. def inputAndCheck (question , validAwnsers): #validAwnsers must be a list global currentAwnser awnserString = input (question) validaty = False convertedAwnser = 0 awnserFlag = False try : int (awnserString) validaty = True except ValueError : pass if validaty == False : inputAndCheck(question , validAwnsers) else : input ( "success: Type Correct" ) convertedAwnser = int (awnserString) for awnser in validAwnsers: if convertedAwnser =...

Yimer and his lost projects!

An adventure is reborn! Me:        Hello, I am Yimer C. Duggan, I was born on March 18th, 2002. I'm an enthusiastic, energetically motivated, observant, and logical person. I like game design and storytelling a lot and I hope to develop my own big game titles one day. my hobbies are drawing and occasionally gaming. Currently, I'm wrapping up my associates at Palm Beach State College and will soon transfer to FAU to finish my Computer Science major. I've been working on python on and off for 2 years now. I think I'm pretty good at it and I hope to become even better as I work on this project. The project:     This will be a full-text adventure game using only the console as the game engine, and it will feature an installer script that will create the main script and recourses for the game. This game is inspired by a similar project I did back in high school and a project I did on the side by myself. They weren't really complete games, but the first was ...