Today, I worked on a function that checks if you, or the enemy player is dead. If you tried to attack the enemy while you have 0 hp or under, you would be reminded that you’re dead, and can’t attack. The same goes for the enemy. The code encircled in red is where the magic happens. In other news, enemy AI. Spoilers much?
Battle Game Update 4/5/24
Before Attack:
After:
I implemented the attack code onto the window. It works as intended except for the fact the hp of the enemy can go into the negatives, which I plan to fix later. As for the block move, It might not exist anymore in favor of something else, like a stat buff. Nothing else to say other than ” Look Ma, this character can live and die now(kinda) “.
Battle Game Update 3/21/24
Today, I created a function that would check if either the enemy, or player was dead. I was planning to move this somewhere, but for now, I’m working on the block moveset. One problem I experienced while working on it is that the enemy blocking the attack would experience more damage than not blocking the attack. This should be relatively easy to fix, but not without thinking. Other than that, coding the game is getting easier than it was when I started. After I fix the issue, I can move on to either completing the other moveset, moving the code to the gui, or fixing other issues in the code.
Battle Game 3/12/24
Today, I made classes that inherit the same properties as the Base Player class. This was done to make things simpler. Using inheritance in my code will help me a lot with my game.
I also worked more on the moves as well. Defined it a bit more. It’s slow, but we’re getting somewhere.
I was just screwing around with different variations on how to code the attack. One issue I found was trying to separate the attack powers. I plan to get to this issue the next time I have time to do it.
Overall, this day wasn’t as productive as I wanted it to be, and the words of the last post should be upheld from now on. If there’s anybody upholding this standard of being more productive for me, it’s me alone.
To Wilmoth,
When this was posted, I already started working on missing work I had in English. I promise that next time, this kind of situation won’t happen again.
Battle Game update
Even though the attack and block code isn’t finished, I added the other moves in the move set the player will have. If I were to critique myself, I would say that progress is real slow for this project. Any other programmer would’ve been able to complete the moves and their functions in a day, or 2. Other than that, I do see this project done before this school year ends. However, I’m not sure when in the school year it will be finished. My approximate guess of when the base game will be finished is between April 20th to April 30th. Then I’ll have May to decorate, or fix any bugs in the game. In short, I need to use my time better.
Tkinter Game Update
Remember the last Tkinter game post where I said the game would run ONLY on Tkinter? I lied. I decided to use Pygame for it. Why? To add sounds to the game.
The code makes sure that whenever I click the ” Basic Attack ” button, a sound will play. The ability to play sound once a button is clicked isn’t really installed on Tkinter, so I imported Pygame to do that. Then, I downloaded an audio file of my choosing from a website. FYI, this website is safe, and I have experienced 0 viruses or errors surfing this site.
If there’s a lesson to learn from this code adventure, then it would something along the lines of ” Sometimes, you gotta break a few rules. “
Java Script Type Conversion
Today, I worked on type conversion with Java Script. Here is some of the code used for type conversion.
This code converts a data type from one to another. ‘0’ as a string turns into 0 as an int.
Later on, this code will determine which, and which is not a number. Overall, JavaScript has a lot of complexities, which is why it’s used for big websites for big companies.
Tkinter Game
Today, I’m working on a python RPG-like game that runs on tkinter. Usually, to make a python game, you would have to use pygame. However, I plan on not using that, but instead, tkinter. Tkinter is used for making python guis(graphical user interface). And today, I’m making a game with it.
What I have for now is the buttons, and a picture of the opponent that I’ll face in the game once I finish the whole code. For now, what I did is create the basic attack move, allowing our character to attack the opponent. If there is anything else for me to say, then what I’ve learned is that dictionaries help a lot with coding.
2/9/24
Today, I worked on a PowerPoint to present to the Downtown YMCA. This PowerPoint is on how to organize, and fix up their meeting room. I suggested installing floor wiring, outlets, wire covers, and buying a wireless meeting camera.