Posts

Showing posts from November, 2018

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