Saturday, February 1, 2020

Lab 3 Completed

1. Introduction
This lab is more complex compared to lab 2. We had 5 different choices, and our group choose option 3 which was pong. We only completed the first part, which was just pong, but we didn't complete the breakout game portion of the code.

2. Writing Code Results
You can check out the completed code here. This code basically has the same logic a cpp version of this program, keeping track of x and y axis, and randomly generating the angles and speed. An additional feature is a score counter which displays at game over.

One particular problem I found interesting was the logic to keep track of the score. The problem was that to keep track of the score, which was the number of times that the paddle hit the ball, you would think to just have a something to keep track of the paddle as it contacted the ball. The problem is, you can record it, but at something like 60 frames per second, which would mean that the score would be around 60 extra points each time the ball contacted the paddle.

Basically the solution to that was to keep track of 2 flags, one keeping track of the the time the ball was in contact with the paddle, and another flag keeping track of when it wasn't in contact with the paddle. When the variable touching the ball and the paddle was not 1, and the flag that kept track of the variable indicated that the paddle and ball were not together, that would mean you can add 1 to the score.

3. My Experiences
Getting the logic to make the pong even in a game like cpp was a bit of a chore for me. When I got the basic logic for a cpp program, the next step was to convert that logic into assembly. After referencing some code snippets, after a lot of work, our group made a working copy of pong. The main reference to make our code was the etch a sketch code (Check it out here!.) A big thing I noticed was that although we used that code as reference, our group didn't use much of it.

1 comment:

  1. Informative blog! it was very useful for me.Thanks for sharing. Do share more ideas regularly.
    Village Talkies a top-quality professional corporate video production company in Bangalore and also best explainer video company in Bangalore & animation video makers in Bangalore, Chennai, India & Maryland, Baltimore, USA provides Corporate & Brand films, Promotional, Marketing videos & Training videos, Product demo videos, Employee videos, Product video explainers, eLearning videos, 2d Animation, 3d Animation, Motion Graphics, Whiteboard Explainer videos Client Testimonial Videos, Video Presentation and more for all start-ups, industries, and corporate companies. From scripting to corporate video production services, explainer & 3d, 2d animation video production , our solutions are customized to your budget, timeline, and to meet the company goals and objectives.
    As a best video production company in Bangalore, we produce quality and creative videos to our clients.

    ReplyDelete