Dodgy Pipe Game代写 – 游戏编程代写 – Game code代写 – CS 1920
Dodgy Pipe Game代写

Dodgy Pipe Game代写 – 游戏编程代写 – Game code代写 – CS 1920

CS 1920 – Assignment 5 : Dodgy Pipe Game

 

 

Dodgy Pipe Game代写 For this assignment you will create a dodgy pipe game using java swing and awt classes. The game will mimic the recently popular ···

 

You may work in Pairs on this assignment if you wish Dodgy Pipe Game代写

For this assignment you will create a dodgy pipe game using java swing and awt classes. The game will mimic the recently popular flflappy bird game.

Your game should:Use a Timer to advance pipe graphic obstacles from right to left across the screen. The obstacles should be generated randomly. And the player will score points each time they maneuver past a set of pipes (their position surpasses the position of a pipe). Using only the mouse to control the vertical position of a character on the screen (without hitting the top or bottom of the screen).

Keep track of the score on the screen for the user to see. The game should go forever and keep track of a high score using a simple text fifile. Use basic Graphics drawing mechanisms for the pipe obstacles.Each time the user clicks the mouse their character should elevate temporarily. And otherwise should accelerate towards the ground. Use a formula as follows to simulate a `flflappy bird’ style flflap:

Where in my solution position. Dodgy Pipe Game代写

y gives the y component pixel position of my character on screen, vertSpeed is set to -1.5 each time the mouse is clicked. Delta is set to 1 and the FALLING_RATE is set to 0.05. I just played around with values until I got something I liked. My position is updated each 15 milliseconds (using the same timer that updates the pipes. And score and checks for game over situations). Your game should stop if the game character collides with a pipe, or the top or bottom of the screen.

You may display a “game over” message or the current score or ask the user to play again at this point. Feel free to elaborate your game as you see fifit. You can download a character of your choosing to act as the obstacle I just googled for a transparent game character and you can fifind many – keep in mind rectangular characters work a little better (or at least characters that are comprised of rectangle-type shapes), the pipes should be drawn with basic Graphics drawing mechanisms (such as two polygon shapes for each pipe).

Dodgy Pipe Game代写
Dodgy Pipe Game代写

Tips and Hints: Dodgy Pipe Game代写

  1. Think modularly – or in an object oriented way. My solution has a Pipe class to handle drawing. And updating the positions of a pipe on screen, a landscape class that keeps track of an ArrayList of pipes and asks them slide to the left each time a timer goes off. A  game character class to keep track of the game character, and update the character’s position, etc.
  1. Draw the pipes on graph paper fifirst so you can get them working fifirst. Don’t worry about moving or generating them randomly or anything like that to start. Get them drawing such that the gap in between the pipes is confifigurable. In my solution I specify two things for the pipes, the top of the bottom pipe and the gap between the pipes. My Pipe class then translates the polygons (one polygon for the top pipe and one for the bottom pipe) into the correct positions. My pipes are large so that they extend off the screen in either direction (then when I translate up or down they are still visible).
  1. Once a single pipe is sliding left to right across the screen you are well onyour way. To make the game character ‘jump or flflap’ upwards on mouse clicks you should implement a basic Mouse Event Listener. The randomness of the pipes is not too complicated. Once the last pipe has passed a certain xlocation you can randomly decide whether to generate another pipe at the edge of the screen or not.

4. Note that you can determine collisions in a simple way: by asking whether a rectangle intersects with a polygon. Polygon.intersects … for my                    Pipe   class I check for intersection with the top and the bottom pipe with a rectangle. Which represents the boundaries of the game character.

  1. The high score and the running score tally are just painted directly on the screen using Graphics drawString.You can use different font or whatnot to make things look nicer how you see fifit.

Submission: Dodgy Pipe Game代写

Each group which may be comprised of either 1 or 2 people should submit a single assignment with the names of all group participants at the top of each class fifile (in the comments at the top of every class).Then one person in the group should zip up your bluej project and submit the zip fifile to their moodle before the assignment deadline using their name:example. If a group contained both David Puddy and Kenny Bania and the group determined David would submit the assignment, they would put both their names at the top of every fifile. Then create a zip called -as5_DAVID_PUDDY.zip and submit that on David Puddy’s moodle.

Grading: Dodgy Pipe Game代写

Code readability – 2 points – correct use of comments (above every method) and variable names and indentation, etc

Code design – 4 points – proper use of classes, and methods and listeners,etc.

Program Functionality – 4 points – does your solution have a dodgy pipe game that plays the correct way

 

更多其他:代写作业 数学代写 物理代写 生物学代写 程序编程代写 文科essay写作小技巧

合作平台:天才代写 幽灵代  写手招聘  paper代写

发表回复