Posts

The Past Three Weeks of My Internship

In this blog, I will be covering what I did in the past three weeks as I kind of forgot to do my blog. Although, I'm just combining all the knowledge that I have gained from these past three weeks. To begin, I mainly stayed around completing "Abstraction and Inheritance" for about two weeks, as I was very confused, but soon ended up figuring out what exactly it was that I was doing. Now, what is abstracting code? Well, abstracting code is making it so we can set chunks of our code into classes. One would call a class for example 'class Character.' Everything within this code would be inside the constructor. It would look like 'constructor() {(**Code Here)}.' Since we define that the class is called Character, all of the lines of code that have the word 'character' are replaced with the word 'this' as we don't want to repeat our code and it is unnecessary if one is already calling the same name for the class. After this, I learned about ...

Doing a Little Review

     Today, I worked on making a gif move. The work I am doing is a little review from last semester. If y'all can't remember, last semester I worked on making a little character move north, south, east, and west. I enjoyed working on my gif move all of these directions. Although, Instead of a little human character, this time we are using Link (A character from the Legend of Zelda).      First I started with a setInterval function. This function held the if statement, that if the direction is == (== is used to compare and not to assign something) to 'right', + 1px to the character's.left attribute. The 1px means to add 1px to where Link is located on the canvas. For example, if Link is assigned '200px' to the left attribute, which is otherwise the x-axis; then adding 1px makes it so the '200px' will keep increasing by one. This means the character will start to move to the right. To make Link go left, one just needs to add -1px . If one wan...

First day of my Internship - New Semester

Today is my first day back at my computer science internship at the Flatiron School. When we got there, our instructor (Joshua Miles) showed us what we were going to be working on this semester. The plan is to work on a videogame that is interactive with the user. Also, one is going to be able to save their progress and sign into the game when they want to play. First off, I did a little bit of review of what I worked on last semester. The first thing I worked on was just putting text on the canvas. One can do this by having an HTML tag called </h1><h1>. This is saying to have some text at the top of the canvas in large letters as it is the header. Some other tags include </h2><h2>, </h3><h3>, and more. The highest number this tag goes up to is </h6><h6>. After this, I went onto implementing a little sprite into the canvas. I was able to assign where this sprite was on the canvas and how large it was. On top of adding this little spri...

Last Day of the Semester

Today was my last day at my internship which is kind of sad, but I am hoping to go back to the Flatiron School next semester. When I got to my internship today, I started to work on my code and I ended up breaking it. "Welp, here we go again," I thought to myself. I broke my collision with the bird. Also, my character wasn't moving. This is all apart of coding. You break your code and then you try and fix it, and then you break it again. A pattern starts to form that keeps on happening. My first approach was trying to figure it out myself by going through the errors on the console, but I couldn't figure it out. I then looked at my GitHub account which is where I can commit my code. Basically, committing your code means that you save your code to this website called GitHub. When your code is working, you will want to commit it, so that if you break your code again, you can look back at your old code that was previously working. I did this, but my code was a lot more ad...

Finally Abstracting my Code and Making an Ice Rink

Today at my internship I worked on abstracting my code. I was finally able to do it. After some help from my internship guy, I was able to abstract out my characters.  These included my bird, the little guy, and the sky. How I did this is pretty complicated, yet very simple when it was explained to me.    First, you make another js file in your folder that already has your HTML file. In this Js file, you want to put everything that applies to one character in it. For instance, if I was abstracting the little guy, then I would take all of the code that created the guy and puts him on the page. Once you have this in another js file, you want to call that js file in your HTML file. This makes it so the HTML recognizes that you want to use a specific js file in your code. I essentially did this for my bird and my sky. Although when I did this, there was one dilemma that I ran into. The dilemma that I ran into was that I couldn't see my character. I was so con...

Implementing Classes

Image
    Today I went to my internship ready to study and learn. I got to the Flatiron School and started to work on my code, but then I went to a standstill. I first opened up the HTML link in google chrome. I saw the sky, the bird, and the man, which is a very good sign. I then tried to move my little guy through the use of my arrow keys, but I just got an error. My little guy was stuck at a standstill. I spent a lot of time looking at my code to see what might be causing this error, but I couldn't find it. I kept trying and trying but soon just decided on asking for help. My Internship guide looked at my code and was able to see the problem. The problem was with one of my variables in my crash function.     After we fixed this problem, It was time to implement classes into my code. Classes essentially just help to clean up your code. So, I put in a class for my little guy, saved it, and then opened the code up in google chrome. I looked at the screen, and t...

Making Classes

    Today I went to my internship and I worked on making classes for my code. A class is essentially for cleaning up your code. It stores a bunch of information in that class which can later be called in the main code.  I started reading about this, and I found some text that seemed very complicated. To my surprise, making a class wasn't as complicated as I thought, although implementing a class into my code is a whole different story.     I made a bunch of classes while I was at my internship. The class I worked on first was for movement. So all of the variables assigned to the keys so that the little guy can walk. There was also a class for the character itself. Another class was made for the bird. The bird in the code posed as an obstacle for my character. When my character came into contact with the bird, he would stop. I also made a class for the crash. This had my huge if statement saying that "if the man (the makeshift square) came into contact...