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 confused about what was happening. My internship guy showed me that you have to specify where the little guy is on the z-axis. The z-axis shows if the character would be in front or behind another picture that was already on the page. Once I fixed this, I had my character, the little bird, and the sky in the background. After that, it was time to go back to school. Today was very fun and interesting.
Comments
Post a Comment