making a game

profilerawanalabbasii
Assignment1.pdf

Fall 21/22 Computer Science Department

NJ

CSC 102: Application Development for Beginners Assignment 1

At the start of your game:

• Create a Background set to the flat Forest scenery • Create a sprite named “mySprite” set to a Rabbit custom • Show to the player a welcoming message • Create one more sprite with a play button custom

When the user clicks the play button • Create a new sprite with a rock custom and size 50px • Set the rock location to be on the ground of background scene, the rock is moving west

and looping • After 2 seconds into the game, add three sprites with carrot custom, and set the sprite

size to 80. Also, set the location of the carrots to be x-axis (380) and the y-axis to be a random integer between 1-300

• Make the carrots move west and looping User can:

• Control the rabbit using the arrows up and down only for movement • Keep track of a score value that is initialized with 0, always show the score to the player

When the rabbit hits any carrot:

• Add 2 points to the score • Re-allocate that specific carrot to a different location with x-axis to 380 and y-axis to

random location between 1-300 • Add a sound that matches the action happing (happy rabbit)

When the rabbit hits the rock: • Remove 1 score • Print a message “Ouch!” with a sound that matches the action

Level two case: • When the rabbit reaches 10 points change the scene and remove all other characters,

except the rabbit • Create two rocks and distribute them vertically on the second background scene • Create three carrots with size 50 and set their location as previously described

Losing case: • When the rabbit reaches 0 or less points, end the game and remove all sprites, show

proper message on screen to the user. Winning case:

• When the rabbit reaches 20 points, congratulate the player on his winning, and end the game by removing all sprites.

Bonus:

• In the second level increase the speed of the rock sprites while moving west and looping