170 likes | 332 Views
By Dan Stalcup. Design and Implementation of an Interactive Simulation Using the JAVA Language Through Object Oriented Programming and Software Engineering Techniques. I'm going to tell you. What my area of research is... What Project Dart Hounder is about...
E N D
By Dan Stalcup Design and Implementation of an Interactive Simulation Using the JAVA Language Through Object Oriented Programming and Software Engineering Techniques
I'm going to tell you... • What my area of research is... • What Project Dart Hounder is about... • What the results have been and the conclusions I have drawn... • Next, I will show you the (unfinished) game and show you how it works • Then, I will briefly show you the various files and the code
Intro • Complex projects require specific design and planning. • What are the benefits and drawbacks of designing a project with an entirely object-oriented programming mindset?
Object-Oriented Programming • Overview: code and data structures divided into “objects” • In JAVA (language used in this project), objects are defined by class files • Example: BankAccount class • Will have ID, Balance, Interest • Thus, we can interchange BankAccounts and know they all will have these features • Extreme example: Ninja class • Will have number of throwing stars, length of ninja sword, height, number of pirates beaten up • We know all Ninjas will have these traits
What do I mean by “entirely object-oriented mindset?” • Whenever approached with a problem or programming situation in which I have a reasonable choice between breaking the parts of the problem down into objects and then solving, versus “imperatively” solving the problem • in other words: break all parts of the game into objects whenever reasonable, rather than combining them into one big file
Project Dart Hounder • Dart Hounder is a complex project: an interactive simulation aka video game. • Break down project into a wide variety of objects, piece them together, analyze results and process.
Dart Hounder: Overview • Dart Hounder is a tactics, grid-based role-playing game. • Two players • Each player controls various characters. • Characters interact with each other and environment • Object: eliminate all opposing characters by attacking them and removing all HP
Dart Hounder: Gameboard • Contains playing field as well as communication devices between user and program, and between objects within a program. • Each square on playing field represented by button. • Squares stored as a two-dimensional array.
Dart Hounder: Square • Squares purpose: contain three necessary objects for each position on the playing grid. • Objects: • Terrain: represents environment • Weather: affects environment • Entity: objects that are placed in the environment • 1 terrain, 1 weather, 0 or 1 entities per square
Dart Hounder: Terrain • Terrains come in several distinct types: plains, water, shoreline, etc. • Have various traits represented by fields, such as temperature and ground density. • One trait calculated by implementation of abstract method: solidity (can an entity be stored in this environment.
Dart Hounder: Weather • Weather affects character interaction • Four distinct types of weather, all defined within a single class. (e.g sunny, stormy) • Each type of weather has distinct traits: visibility, temperature.
Dart Hounder: Entities • Entities are the agents of user interaction with the program • Two types: character, non-character • Characters controlled by users, non-characters controlled by program • Each entity has specific traits, including HP, position (matches position of its square), etc.
Dart Hounder: Noncharacters • Non-characters are in three categories: minerals, plants, animals • Non-characters have the traits of all entities, plus two new ones: whether or not it is living, and whether or not it is moving.
Dart Hounder: Characters • Characters are controlled by users • Have traits of entities plus several new ones, including energy and MP (magic points). • Characters can move from square to square, interact with one another, and interact with non-characters. • Each character has a unique name.
What Am I Looking For In Results? • Benefits and drawbacks of an entirely object-oriented approach to software development • Simplicity and power of writing code and designing program? • Ability to fix bugs and solve problems? • How easy is it to expand program? • Maximize features of object-oriented programming? • Is code relatively readable?
Results Thus Far: Pros • flexibility (fix a problem once, it is fixed for several things) • easy expansion (making additions are usually as simple is making new classes just a few lines long) • easy to find problem within file if file is isolated
Results Thus Far: Cons • complex interaction between files • hard to isolate which file errors are in • some problems that are solved with new files could be solved with just a few lines instead