QuestionQuestion

Transcribed TextTranscribed Text

Project 1: Interactive Scripting Pong Game Description For your first assignment, you are required to modify an existing interactive ActionScript (AS) or JavaScript (JS) program. This project requires you to modify a remake of the famous Pong game invented by Nolan Bushnell in 1972 using ActionScript/Adobe Animate or JavaScript. Nolan Bushnell founded Atari two years later. Game Instructions The game of Pong resembles real life Table Tennis or Ping Pong. The object of the game is to make your opponent miss the ball, thus earning a point. Paddles are used to bounce the ball in your opponent's direction. This is a one-player version. The user controls the left paddle. The computer artificial intelligence (AI) controls the paddle on the right. The remakes of both versions of the game are incomplete but functional as an instructional guide. JavaScript Project Directions The JavaScript code for this assignment is embedded into an HTML file. Modify the HTML file to complete the assignment. Please follow the steps below: 1. Download the JavaScript project file (project1JS.html.txt) attached to this project description. 2. Rename the file from project1JS.html.txt to project1JS.html (Remove the .txt file extension) 3. Place the downloaded project file into a folder you create on your computer. All of the files for your project should be placed in the same folder. 4. Open the project1JS.html file in a browser (e.g. Internet Explorer, Safari, Firefox). 5. Make sure the script works as it is intended. 5. Open the project1JS.html file in a text editor or web editor. 6. Modify the JavaScript code in the HTML file. 7. Rename the file back from project1JS.html to project1JS.html.txt (Re-add the .txt file extension) 8. Upload your modified txt file to your Assignments Folder. 9. Verify that your submission was successful. 10. Complete and submit a Project Reflection. What Do You Need to Complete this Assignment? To complete this assignment, you will need to edit the HTML project file. You can accomplish this by using: 1. a Text Editor such as for Windows or for Mac computers (both are free to download and use). 2. an online JavaScript compiler such as w3schools' Just replace the existing code in the column on the left with the contents of the HTML project file, modify it and test it by clicking the green Run button. The output appears in the right column. JavaScript Submission Requirements Please complete the following changes: 1. Modify the speed of the ball. 2. Modify the size of the ball. 3. Modify the height of the canvas. 4. Modify the width of the canvas. 5. Modify the speed of the player's paddle. (Note: The player's paddle is located on the left side of the canvas) 6. Modify the speed of the AI's (computer's) paddle. (Note: the AI's paddle is located on the right side of the canvas) Note: Your modifications must alter the game but not in a way that makes the game unplayable. Experiment with different values to find ones that are not too extreme. Advanced JavaScript Challenge If you completed this assignment with relative ease and want to learn more, consider making additional modifications or changes in the existing code. Here are some examples: 1. Add a start/stop button 2. Create a scoring mechanism 3. Add sound Note: The Advanced Challenge is not a graded requirement. Project Reflection Answer the following questions when you submit your assignment files: 1. Which scripting langauge did you select (JavaScript or ActionScript)? Why did you choose this langauge? Be specific. 2. What modifications did you make to the script? Include details on what you changed in the code in order to achieve these modifications. 3. Did you make any advanced modifications? If yes, include details on what you changed in the code in order to achieve these modifications. If no, describe why you chose not to make any advanced modifications. 4. What issues or challenges did you face completing this project? How did you resolve them? If you did not face any issues or challenges in completing this project, what do you think are some issues or challenges someone new to scripting might face in completing a project like this? Note: Your reflection must be a total of at least 200 words. Please submit your Project Reflection as a Microsoft Word document or just copy and paste your answers in your Assignments Folder's text box when you submit your assignment along with the rest of the required project files. ActionScript Project Directions ActionScript is a scripting language that is used within Adobe Animate (formerly Adobe Flash). You will need a working version of Adobe Animate to complete this version of the assignment. Modify the ActionScript inside of the Adobe Animate (Flash) file to complete the assignment. The latest version of ActionScript is 3.0. Please follow the steps below: 1. Download the ActionScript project file (project1AS.fla) attached to this project description. FLA is the file extension for Adobe Animate. 2. Place the downloaded file into a folder you create on your computer. All of the files for your project should be placed in the same folder. 3. Open theproject1AS.fla< file in Adobe Animate. 4. Make sure the game works as it is intended by starting the game by using the Test Movie comment (Control > Test Movie > In Animate). The Test Movie command will create a .SWF version of the game. This file will be added to your project folder automatically. 5. Access the ActionScript code associated with this project by locating it on the timeline on the ActionScript Code Layer, first Keyframe. 6. Right-click on the first Keyframe in the ActionScript Code Layer and select Actions. This will open the Actions window which contains the ActionScript code for the project. 7. Modify the ActionScript. Test your results. 8. Save and upload your modified project1AS.fla Adobe Animate file to your Assignments Folder. 9. Verify that your submission was successful. 10. Complete and submit a Project Reflection. Note: The left player's paddle is controlled by moving your mouse up and down. What Do You Need to Complete this Assignment? To complete this assignment, you will need to edit the Adobe Animate project file. You can accomplish this by using: 1. Adobe Animate. If you do not have access to the application, you can download a 7-day trial version. ActionScript Submission Requirements Please complete the following changes: 1. Modify the speed of the ball. 2. Modify the size of the ball. 3. Modify the height of the canvas. 4. Modify the width of the canvas. 5. Modify the speed of the player's paddle. (Note: The player's paddle is located on the left side of the canvas) 6. Modify the speed of the AI's (computer's) paddle. (Note: the AI's paddle is located on the right side of the canvas) Note: Your modifications must alter the game but not in a way that makes the game unplayable. Experiment with different values to find ones that are not too extreme. Advanced ActionScript Challenge If you completed this assignment with relative ease and want to learn more, consider making additional modifications or changes in the existing code. Here are some examples: 1. Add a start/stop button 2. Create a scoring mechanism 3. Add sound Note: The Advanced Challenge is not a graded requirement. Project Reflection Answer the following questions when you submit your assignment files: 1. Which scripting langauge did you select (JavaScript or ActionScript)? Why did you choose this langauge? Be specific. 2. What modifications did you make to the script? Include details on what you changed in the code in order to achieve these modifications. 3. Did you make any advanced modifications? If yes, include details on what you changed in the code in order to achieve these modifications. If no, describe why you chose not to make any advanced modifications. 4. What issues or challenges did you face completing this project? How did you resolve them? If you did not face any issues or challenges in completing this project, what do you think are some issues or challenges someone new to scripting might face in completing a project like this? Note: Your reflection must be a total of at least 200 words. Please submit your Project Reflection as a Microsoft Word document or just copy and paste your answers in your Assignments Folder's text box when you submit your assignment along with the rest of the required project files.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

<!doctype html>
<html lang="en">
    <head>
       <meta charset="UTF-8">
       <title>Pong</title>

       <!-- Basic styling, centering the canvas -->
       <style>
            canvas {
                display: block;
                position: absolute;
                margin: auto;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
            }
       </style>
    </head>
    <body>
       <script>
            var
                   /**
                     * Constants
                     */
                   WIDTH = 1000, /* 4.Modify the width of the canvas. */
                   HEIGHT = 400, /* 3.Modify the height of the canvas.*/
                   pi = Math.PI,
                   UpArrow = 38,
                   DownArrow = 40,
                   /**
                     * Game elements
                     */
                   canvas,
                   ctx,
                   keystate,
                   /**
                     * The player paddle
                     *
                     * @type {Object}
                     */
                   player = {
                        x: null,
                        y: null,
                        width: 20,
                        height: 100,
                        /**
                         * Update the position depending on pressed keys
                         */
                        update: function () {
                            /**
                            * 5.Modify the speed of the player's paddle.
                            * (Note: The player's paddle is located on the
                            * le...

By purchasing this solution you'll be able to access the following files:
Solution.docx and project1JS.html.

$29.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Web Development (HTML, XML, PHP, JavaScript, Adobe, Flash, etc.) Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats