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 what 'extend' does and what 'super' does. It turns out when one wants to call a subclass of a specific class then they can use the word 'extend.' An example of this would be 'class Character extends GameObject.' This shows that the class Character extends or is a subclass of GameObject. Essentially referencing the other class. Then the word 'super' in this case is a function that is referencing the parent class of GameObject. I also learned about switching the gif that was used to a different one. This was because our code is reusable, which means I can call instances of classes as many times as I want. I was able to make another gif with a new location (The gif we use is Zelda). This was essentially what I worked on for the past two weeks. Now I will talk about this week. I worked on abstracting all my code into different files. When one does this, they must call that specific file in the index.html file. This is the code that has to be put in when referencing another JS file. <script src="Character.js"></script>. After I worked on this for a while, it was time to go back to school. I had a really fun time and I am excited to go back after A-Term.

Comments

Popular posts from this blog

Doing a Little Review

Making Classes

Using the Arrow Keys