Posts

Showing posts from December, 2018

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...