Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
Create a Simple Frogger Game - Assignment

Phase 1: World and Frog

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

support
Whatsapp
callback
sales
sales chat
Whatsapp
callback
sales chat
close