Final Documentation C#

Embed Size (px)

DESCRIPTION

C# Documentation

Citation preview

AcknowledgementIn performing our assignment, we would like to take this opportunity to express our gratitude to all those who provided us the possibility to complete this course of Computer Graphic assignment. A special and deepest appreciation we give to our lecturer of Computer Graphic, Mr. Jacob Sow Tian You for the support and guidance throughout this assignment. Without the knowledge and lesson has been taught throughout these fourteen weeks, we will never able to complete this assignment successfully.

A warm thanks to my fellow teammate for the stimulating discussions in working hard to produce a good assignment with all afford and responsibility. Hope that all the afford will be paid out in the future. We are grateful to a bunch of classmates in giving us many valuable comment suggestions on this assignment, which brought us an inspiration to improve our assignment.

Last and not least, million thanks to the family member who giving fully support no manner it is in mentally, physically or financially support for pushing us to the bright road. We express our sincere gratefulness to all the people for their help directly and indirectly to complete our assignment. The completion of this assignment gives us much pleasure.

Objective The objective of Computer Graphic assignment: To develop the skills in relation to areas of computer graphic and vector graphic programming. To develop the ability and problem solving to implement a vector based particle system. To develop the critical thinking skills to design a vector based particle system.

Project Background

In this assignment, our group has been created a 2D vector based particle system, which consists of particle effect simulation with the name Space Ship. Particle effect simulation is a large number of very small sprites, 2D or 3D objects that stimulate certain kinds of fuzzy phenomena. Example of such phenomena that commonly used in particle system included ember, smoke, sparks and many more. We are requested to demonstrate three aspects in this application. First of foremost, it is the spawning aspects which is the ability for the application to create particles that resemble the desired effect. It is the most important aspect throughout the whole assignment. Secondly, it is the ability to allow user to specify parameters that will affect the particles. Basically, it is the ability to control the entire application. Thirdly, it is the attachment aspects. It is to part to implement the particles to spawn on specific objects and areas within a simulated game. These three aspects have been successful implement to the application with the use of ADDIE methodology. This methodology represents a dynamic, flexible guideline for our group to implement the assignment consistently. The main source that used to create this application is Microsoft Visual Studio. It consists of built-in languages such as C, C++, C# and many more. In this assignment, our group has been used the C# as the main programming language to create the application.

Software Requirements Visual Studio

Microsoft Visual Studio is an Integrated Development Environment (IDE) that created by Microsoft Corporation. It basically is a suite of component-based software development tools and other technologies for building powerful- high-performance application. (Msdn.microsoft.com, 2015) It has the ability to build application iOS, Android and Windows devices. Microsoft Visual Studio typically consisting of a code editor, a compiler, a debugger and a graphical user interface (GUI) builder. It consists of code editor supporting IntelliSense, which is the code completion component. Users can build application locally with the compiler and make sure that it works correctly whereas use the debugger to fix any issues with the application. So, it provides easy code navigation, fast builds and quick deployment. Microsoft Visual Studio increases peoples productivity and makes people easy to do work alone or as part of a larger team.

Besides that, Microsoft Visual Studio supports nearly all types of Programming Languages to create device or desktop application. It is also provided a language-specific service exists to assist the users convenience. The built-in Programming Language able to convenience user in implementing all type of Programming Language in one single software development tool. Moreover, Microsoft Visual Software contains thousands of extension for user to include a tool or script that they often use while coding. It contain from Hypertext Preprocessor to gaming area. Users are offered to create custom menu item and tool windows to integrate their own tools into the Visual Studio Intergraded Development Environment (IDE). Users able to extend the Visual Studio editor to analyze and fix the code, or add a new project type to include any thing they need.

C# Programming Language

C# programming language is a type-safe object oriented languages which is highly expressive, yet it is also user-friendly and easy to learn. (Msdn.microsoft.com, 2015)Object oriented programming is a deign philosophy that grouped as self sustainable object and gain reusability by means of four main object oriented programming concept which is encapsulation, abstraction, inheritance and polymorphism. This four object oriented programming concepts have been lead us a lot of inspiration in planning and designing this application. Lets brief justify about these four object oriented programming concepts.

First of foremost, encapsulation is a process of enclosing one or more items within a physical or logical package. In the object oriented programming methodology, encapsulation is to prevent access to implement detail by using five types of specifies. There are public, private, protected, internal and protected internal. Secondly is the abstraction. Abstraction is an emphasis on the idea, qualities and properties rather than the suppression of detail. Abstract class is a concept and implementation that get completed when it is being realized by a subclass.

Thirdly is the Inheritance. It happened when a class able to inherit or extend properties and methods to another class. The subclass can also add additional properties and methods to change some of the ones from the class that is being extended which named the superclass or base class. However, it would not able to implement when the properties and methods are marked as private. Last but not least, polymorphism define as the ability to request that the same operations be performed by a wide range of the same operations be performed by a wide range of different types of things.

XNA Platform In this assignment, our group requested to install an extension in our software development tool, Microsoft Visual Studio to build this 2D vector based particle system, which is the XNA platform. This platform is an integrated development environment (IDE) designed to make it more convenience in developing games for Windows Phone, Xbox 360, and Windows. (Msdn.microsoft.com, 2015)It consists of XNA Framework and tools, which is a managed-code class library that contains features targeted specifically at game development since it supports 2D and 3D gaming. It is designed to set up the function needed to create a game automatically when a new project is created. It is truly convenience for the users, as they just need to create the objects and move the objects with user input. It also includes tools for adding graphics and audio content to the users game. It is designed to follow .NET Framework design patterns and idioms in order to use the capabilities more general. Besides, XNA Framework contains several libraries that are specifically for 3D graphic for game development. It is the library of classes, interfaces, and value types, which provides access to XNA Framework functionality and is designed to be the foundation. However, it does not support several controls such as buttons and text boxes. It also does not have a designer window.

Design

The game is developed using Microsoft Visual Studio and implemented in XNA Platform. We have used arrays, with list-like capability for better performance. The game consists of three states; (i) the initial state - that is the main menu, (ii) the game state that is playing the game, (iii) over state that is, the game ends with an explosion.The main components are cubes, particle effects and the ship. The theme acts as a complimenting factor for the above components. The output of the game is separated into three layers: i. Background: The background is composed cubes in the lower half, and sky with particle effects in form twinkling stars in the upper half. ii. Character: The ship is the main character of this game. It leaves a trail of particle effects as it moves forward. Also, when the ship strikes with the cube, an explosion in form of particle effects is displayed, and the game is over.iii. Heads-Up Display: The HUD is placed on the top of the game screen. On the top-left section shows the score of the current game, while the top-right section shows the highest score achieved.

Code Snippet (C#)

Game elements/objects Configuration and UV is texture co-ordinates

Array with List like capability but should be better in performance

Structure of cube objectAdding Gravity and Update position of the particle

Flowchart

Spaceship Game Flow

Storyboard and Screen Design

To start the Game the User need to press Enter key which will allow the user to play the Game

Once user enters the Game, Spaceship Starts to move forward leaving trail particle effect and the User is allowed to navigate the Ship with Left and Right arrow Keys

When the Ship Cashes with a Cube, Game is over.

The main Cube and the Ship

The Twinkling Stars with Current Score (Left) and Best Score (Right).Game Development using ADDIE methodology

This game was developed using Analysis, Design, Development, Implementation, Evaluation (ADDIE) Methodology. ADDIE Methodology is a multimedia methodology used for creating multimedia systems. As the phases of this methodology went well with our game plan, and analysis, we have adopted this approach in developing this game with particle effects. Besides that, every phase of development was to be followed by an evaluation phase, thus justifying the use of this methodology. Discussing various phases of undergone to develop this game below: i. Analysis Phase Evaluation Phase: After setting the objectives, we defined the application scope, and understood the software requirements for this game. Then, application of functional specifications was mind mapped according to the assignment specifications. Later, we took a step towards initiating the application. ii. Design Phase Evaluation Phase: a. Outline Design: In this stage, we analyzed the needs of the assignment and refined its feasibility and started structuring the program. b. Detailed Design: In thus stage, screen design played an essential role towards developing the flowchart and the storyboards. Multimedia assets and scripting techniques were finalized.iii. Development Phase- Evaluation PhaseIn this phase, graphics were produced, software codes were designed and particle effects were initiated.

iv. Implementation Phase Evaluation PhaseIn this phase, all the components came together. Transformation from code design to code implementation came about. This was followed by integration of all the components and testing of the final product. Required maintenance was applied in form of acceptance testing.

ConceptThe concept of this game has been synonymous throughout, and was implemented accordingly. The concept behind this game is a small ship travelling forward into the space, filled with cubes which are randomly placed in the lower half. The sky serves as a background for the setup, and is the sky filled with stars (particle effects). The ship is in acceleration mode, and navigates left or right to save itself from the cubes. When the ship crashes with a cube, an explosion occurs (particle effect) and the game is over. Score is noted, and if it is the highest score till date, it is shown on the top right corner on the HUD of screen every time the game is played again, till the record is surpassed.

Environmental DesignThe environment of this game is designed to be minimalistic to avoid distraction, focusing on the main requirement of this assignment, the particle effects. The surface (bottom half) of the game, where the ship navigates has a metallic gray background on which cubes are randomly placed. The ship is shown to be approaching in a forward direction towards an unending horizon. It leaves a trail of particle effects behind while it moves forward. The sky with twinkling stars are placed (upper half), to resemble the space ambience.

Installation and testing (Evaluation)

When we played the game after tuning and polishing, the output corresponded to the requirements of the assignment. We then tested the game in other computers, and received a synonymous response. It also worked successfully as a game application in XNA installed computer devices.

User Manual

Conclusion

To conclude with, wed like to thank Mr. Jacob Sow Tian You for guiding us throughout the course of this semester, and showing us various applications for developing XNA Game for Windows using Microsoft Visual Studio. This was the first module so far, which required us to create a game using programming concepts. It was always easy to think of various effects while playing a game, like objects crawling, flying or particles twinkling, shimmering, in a particular way, and so on. However, it was only in this module, that we gave a solid structure to our thoughts, and created our own game, with particle effects. Needless to say, it has been an extremely daunting task, from paying attention to the minutest details, to cohering to the main idea. This assignment is a sincere effort from both of us as a team, and we hope it fulfils the requirement of the module. Learning Computer Graphics definitely helped us to broaden our views and perspectives about the field of Multimedia Technology. We look forward to learn the module in-depth in the coming semesters.

Reference

Msdn.microsoft.com, (2015). Visual Studio Resources | MSDN. [Online]. 2015. Available from: https://msdn.microsoft.com/en-us/vstudio/cc136611.aspx. [Accessed: 3 September 2015].

Msdn.microsoft.com, (2015). Getting Started with XNA Game Studio Development. [Online]. 2015. Available from: https://msdn.microsoft.com/en-us/library/bb203894.aspx. [Accessed: 3 September 2015].

Msdn.microsoft.com, (2015). Introduction to the C# Language and the .NET Framework. [Online]. 2015. Available from: https://msdn.microsoft.com/en-us/library/z1zx9t92.aspx. [Accessed: 3 September 2015].