Dodge in Gaming

Only available on StudyMode
  • Pages : 8 (2766 words )
  • Download(s) : 16
  • Published : March 2, 2013
Open Document
Text Preview
The Dodge Game - Software Design and Modi ability
This report is submitted in partial ful lment of the requirements of the ELEN7045 - SD Methodologies, Analysis and Design

Abstract
The Dodge Game is a mini project in Software Design and Modi ability. The results of this development process are supposed to an executable game capable of running in a Windows environment. The game has be a developed using object oriented principles and makes use of a simple graphics. The chosen development environment was java and the graphics library was the Java 2D graphics. The approach taken in the design was a decoupling or component based design. The implemented solution runs on a JPanel and renders graphics on to the game screen with inheritance being used to extend classes. The selected design choice was mo- tivated by modi ability and an attempt to make changeability as easy as possible. i

Contents
1 Introduction 1
2 Addressing the Problem 1
2.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.2 Design of Proposed Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.2.1 Functional Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.2.2 Architectural design . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.2.3 Justi cation of the design Choice . . . . . . . . . . . . . . . . . . . 3 3 Critical Analysis of the Design 3

3.1 Modi ability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.2 Supported Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4 Conclusion 5
List of Figures
1 Dodge Game Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 2 ii
1 Introduction
The requirement of the mini project was to design and implement a windows game that has randomly appearing raindrops in the top quarter of the game screen. A player who is controlled by the keyboard attempts to dodge these rain drops in order to survive. This report will attempt to describe the design and development of the Dodge game. It also will present a critical analysis of the chosen design against several possible modi cations given in question as a way to nd a better or the best design. The report will address the problem domain rst, move to the design and end with a critical analysis. In the report the phrase `Game Screen' is used to interchangeably to refer to the Rg GameScreen class, `Rain drop' refers to the Rg RainDrop class and `Player' refers to the Rg Player class 2 Addressing the Problem

2.1 Problem Description
Looking at the given question, the game is meant to be a single player. From this line it shows the need for a player class to control the player. The game question circles around the raindrops, which have to be a single class as well. There is need to control the number of raindrops that are on the screen at a particular time, thus there is need to have a constant variable in the raindrop class. The disappearing of raindrops should trigger a new raindrop on the top of the screen. This scenario means we should control the screen measurements in order to know whether or not the raindrops have passed the bottom or not. The game objective is to dodge the drops in order to keep the game running. This brings the need for a method of dodging the raindrops. Since the game is dependent on the player surviving not getting wet, a collision method is needed to listen to whether the player was hit but the raindrop or not.

2.2 Design of Proposed Solution
2.2.1 Functional Design
The game is designed to be controlled by the arrow keys, left and right as required.These are con gured in the Keypressed event and Keyreleased method. The player is an image is a player and in this implementation is surrounded by a virtual rectangle which will be discussed below. The raindrops have a similar design. The following section will jus- tify this design criteria. Raindrops positions are generated randomly as required using a math.random()...
tracking img