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

Crashing and Stopping

Image
    Today at my internship I worked on making my little person stop when he crashed into the bird. I implemented the bird in my code last week. This was pretty difficult when I started to do it, but I soon got the hang of it.     First I needed to find the dimensions of my little character. Since my little guy isn't a perfect square, I had to make one. Instead of finding some complicated dimensions of this abstract guy, I just put the dimensions of a square that was very close to the height and width of the little guy. After I did this, I did the same thing with the bird. Since the bird is also an abstract shape, I found the dimensions of a square that was very close to the height and width of the bird.     Now came the hard part for me. I then had to find a way to say that "if this first square (the little guy) crashes into this other square (the bird) then console.log("Crashed") + stop(). The last part of the if statement might seem confusing, but it is...

Making Obstacles

Image
Making Obstacles Today at my Internship, we worked on our same project. Although, today we implemented this little bird into our code. It seemed very complicated at first, but then I looked at my code and noticed that I was basically doing the same thing with another image that was already put onto the page.         How I did this was simple. First I was able to drag the image into visual studio. Visual Studio is an app that allows one to run Javascript and HTML files. Then you have to assign where the bird is going to be on the page. Do you want it to be at the very top left? Do you want the bird to be at the bottom? Do you want the bird to be in the middle? I made it so the bird was on the top left-hand side of the screen. I am now trying to make it so that whenever the little guy runs into the bird, the stop function commences. As a review, my stop function essentially stops the little guy on the screen from walking. Instead of me typing stop(), the ...

Using the Arrow Keys

Using the Arrow Keys     Today was the third time being at my internship. Exciting right!! I continued on the same project that I have been working on from last week. Last week I worked on making a little giph walk north, east, south, and west, through the use of some functions. I would essentially call a function that I had already created. For instance, if I called walkNorth(). This is telling the console that I have called this variable, and that the computer is going to find this walkNorth() variable and run what this variable is assigned to do. In this case, I assigned this variable to walk north. How I did that is a little more complicated, so for now, all you need to know is that this giph walks north when the variable walkNorth() is called. I also made different variables called walkEast(), walkSouth(), and walkWest, and assigned them to walk in there specific direction. Calling these variables one by one is kind of inconvenient because I would h...

Learning JavaScript

Image
Learning JavaScript     Today I continued studying javascript. First I was given a task to try and understand what was going on in a code. I took one glance at this, and I thought, "Okay, what does this all mean." I started stressing, tapping the table, and bouncing my leg up and down, wondering how I was going to do this. I kept on studying this code and started to understand some of the different lines of text. At this moment I felt like a genius. So many thoughts and question were bouncing through my head that I couldn't even think straight. I was just really happy that I started to understand this code.    The whole point of the code was to make this little figurine move to the south, north, east, and west. I did this using multiple things. For example, a lot of variables were used. A variable is a storage place where one can call back the things that are in the variable. If you had something like this, `var a = "Asher Forman."` Then now...

The First Day

Image
The First Day     Today was the first day of my computer science internship. I did not know what to expect when I got there. I didn't know If I was going to enjoy it. I didn't know if I was going to be any good at coding. A bunch of thoughts were going through my head. When I got to the Flatiron School in Downtown, my stomach was churning and doing flip-flops. It was more or less a bit of nervous excitement. I arrived and went upstairs to the lounge area. There we met the person we were interning with. He took us downstairs and into the apartment floor that Flatiron was located on. He was very friendly and took us to a room to get started.      The first thing I did was to start a JavaScript course online. I had done something like this, so I was getting the hang of it pretty quickly. You might be wondering what Javascript is, and so was I when I first started to code. Javascript is a language in computer science that can help with adding effects to a web...