COMP1010 Introductory Computer Science

FroggerBackground: Frogger was a classic video game. In this assignment you will create a simple game roughly based on Frogger. The idea of the game is to move your “frog” (a green circle) from the bottom of the canvas to the top of the canvas, without being hit by any of the moving hazards in the middle. The frog moves in large jumps, not smoothly.When the game starts, at Level 1, there should be 3 lines of moving hazards, as shown above. If the frog reaches the top, then the game should move to the next level, add one more line of hazards, and start the frog at the bottom again. So there will be 4 lines of hazards at Level 2, 5 at Level 3, and in general (n+2) at Level n. Phase 1: World and FrogUse a fairly large window. Your program should work with any size window. If you replace the size(w,h)command with the fullScreen()command, your canvas will be the full size of your computer screen. Try it. Your program should work at that size, too.Write a function void drawWorld() to drawthe basic world. Use a globalinteger variable levelto control the game. For now this will always be 1. It will not change until you implement Phase 5. Divide the canvas into level+4equally sized horizontal bands. The top band and bottom band should be a different colour than the level+2middle bands, as shown. Use any colours you like, as long as they are contrasting. The height of these bands will be a very important number in the program, and you should store it in a global variable bandHeight. Write a function void drawFrog(float x, float y, float diam)which will draw a “frog” centred at coordinate (x,y) with the given diameter. You can use a simple green circle, as shown. If you like, use some other shape, or draw a fancier frog.Write a function void moveFrog(float xChange, float yChange)which will move the frog the given amount in the x and y directions.(It will change the global variables that control the frog’s position.)Write the special void keyPressed()function to make the frog jump up, down, left, or right using the WASD and IJKL keys on the keyboard. In this program, movement isnot continuous. The frog should make one jump each time a key is pressed.The keyPressed()function will be automatically called once each time a key is pressed, and you can use the variable keyto tell which key it was.The frog should jump up/left/down/right if eitherthe WASD orIJKL keys are pressed. Also allow for uppercase or lowercase charactersto be used(just in case Caps Lock is on).Complete the program so that the frog jumps around the canvas. The frog should begin in the exact centre of the bottom band. The size of the frog should be controlled by bandHeight. Later in the game, at higher levels, the bands will be smaller, and the frog must be smaller, too. In this Phase, it doesn’t matter if the frog jumps out of the canvas.The size of the jump will be the same as the bandHeight so the frog always makes one jump per band if it is movingup or down.Phase 2: Keep the Frog in the canvasWrite a function boolean objectInCanvas(float x, float y, float diam)which will determine whether or not a circle or square with the given position and diameter will be within the canvas or not, in whole or in part. It should return trueif anypart of the object would be insidethe canvas, and falseif the object would be completely outside the canvas.Modify your moveFrogfunction so that it will not allow the frog to jump completely outside the canvas. You must use your objectInCanvasfunction to chec

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 (929) 473-0077

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code SCORE