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.

Circuit Python project

Today, I’ve been working on creating a piano with circuit python. I have most of my C scale programmed on the board, and I’m planning to add more scales to it.

How does it work? If you touch a certain part of the board, it produces a pitched sound. One part of the board produces a different pitch than the other. How it does it is the frequency number. For example, a C note is 261.63 Hz.

from adafruit_circuitplayground import cp


while True:
    while cp.touch_A1 or cp.touch_A2 or cp.touch_A3 or cp.touch_A4 or cp.touch_A5 or cp.touch_A6 or cp.touch_A7:
        if cp.touch_A1:
            cp.start_tone(262)

        if cp.touch_A2:
            cp.start_tone(293)
        
        if cp.touch_A3:
            cp.start_tone(329)
    
        if cp.touch_A4:
            cp.start_tone(349)
            
        if cp.touch_A5:
            cp.start_tone(391)
            
        if cp.touch_A6:
            cp.start_tone(440)
            
        if cp.touch_A7:
            cp.start_tone(493)
    
    cp.stop_tone()

https://learn.adafruit.com/sensor-plotting-with-mu-and-circuitpython/capacitive-touch

https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/play-tone