Description, Classes, Interfaces, Hierarchy, Specifics George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net.

Slides:



Advertisements
Similar presentations
Video Game Design Lesson 1. Game Designer Person involved in the development of a video game Person involved in the development of a video game Usually.
Advertisements

Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Asteroids Games and Simulations O-O Programming in Java The Walker School The Walker School – Games and Simulations
CSE 1302 Lecture 8 Inheritance Richard Gesick Figures from Deitel, “Visual C#”, Pearson.
Object Oriented Programming Chapter 7 Programming Languages by Ravi Sethi.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Development Software Life Cycle UML Diagrams.
Chapter 3 Collections. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 3-2 Chapter Objectives Define the concept and terminology related.
1 Flash Actionscript Animation. 2 Introduction to Sprites We will now look at implementing Sprites in Flash. We should know enough after this to create.
Inheritance, Shared. Projectiles Program Demonstrates – Inheritance – MustInherit – Shared vs. Non-shared methods A variation on the Multiball example.
Lecture 1 CS171: Game Design Studio 1I UC Santa Cruz School of Engineering 5 January 2010.
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
MASHOOQ,RAHUL,SANAT AND YIBIN, SAVING MANKIND SINCE SPRING 2011.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
GameMaker.  A lot of Different Definitions  Easier to Say What is NOT a Game  Movie is Not a Game  No Active Participation  Final Outcome is Fixed.
Guide to Programming with Python
CSE 381 – Advanced Game Programming 3D Game Architecture.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
CPSC 171 Introduction to Computer Science 3 Levels of Understanding Algorithms More Algorithm Discovery and Design.
Introduction to TouchDevelop
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
OOD Case Study (For parallel treatment, see Chapter 2 of the text)
KeyListener and Keyboard Events Just as we can implement listeners to handle mouse events, we can do the same for keyboard events (keypresses) –to implement.
Art 315 Lecture 5 Dr. J. Parker AB 606. Last time … We wrote our first program. We used a tool called GameMaker. The program we wrote causes a ball to.
Programming Pillars Introduction to Object- Oriented Programming.
UFCFS D Technologies for the Web Unity 3D: Review of Topics and Related Concepts.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Intermediate 2 Software Development Process. Software You should already know that any computer system is made up of hardware and software. The term hardware.
11 Working with Images Session Session Overview  Find out more about image manipulation and scaling when drawing using XNA  Start to implement.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
XNA An Introduction. What XNA is… Microsoft® XNA™ is composed of industry- leading software, services, resources, and communities focused on enabling.
GAME:IT Helicopter Objectives: Review skills in making directional sprites Create objects that shoot and destroy for points Create random enemies on the.
Chapter 5: Ball Worlds Features 2 classes, constant data fields, constructors, extension through inheritance, graphics.
Rob Miles. How does an XNA game program work? Programs tell computers what to do A program is written in a programming language – C# is a programming.
Object Oriented Software Development
Game Maker – Getting Started What is Game Maker?.
UFCEK-20-3Web Games Programming Unity 3D: Review of Topics Publishing for the Web.
Object Oriented Analysis & Design Game Patterns. Contents  What patterns are  Delegation  Game Loop  Scene Graph  Double Buffering  Component 
Game Maker Tutorial.
M1G Introduction to Programming 2 5. Completing the program.
Warlords Patrick Levoshko SE 558 – Multiplayer Game Design.
GOSS iCM Forms Gary Ratcliffe. 2 Agenda Webinar Programme Form Groups Publish Multiple Visual Script Editor Scripted Actions Form Examples.
Programming Games Show your rock-paper-scissors. Demonstrate bouncing ball. Demonstrate and examine Bo the dog. Homework: Modify Bo to make your own.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
CompSci Introduction to Jam’s Video Game Package.
11 Adding a Bread Bat Session Session Overview  We have created a cheese sprite that bounces around the display  We now need to create a bread.
Object-Oriented Programming: Inheritance and Polymorphism.
Collections Using Generics in Collections. 2 Chapter Objectives Define the concept and terminology related to collections Explore the basic structure.
Tank Game Part 2 of 6. Firing Shells Coming up… Players Scores Large Explosions Small Explosions Damage Health Bars Parent Shell Destructible Walls Reappear.
Android Fragments. Slide 2 Lecture Overview Getting resources and configuration information Conceptualizing the Back Stack Introduction to fragments.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Sound and more Animations
Object-Oriented Programming Concepts
7.1 What Is An Object Object-oriented program - Description or simulation of application Object-oriented programming is done by adopting or extending an.
Interface Java 7 COMP T1.
UML UML Sequence Diagrams CSE 403
Introduction to Events
TECHNICAL POSTER Laser reactant objects Interactive Doors and Saving
Lecture 22 Inheritance Richard Gesick.
Arrays
Week 6: Time and triggers!
Fundaments of Game Design
CIS 199 Final Review.
Presentation transcript:

Description, Classes, Interfaces, Hierarchy, Specifics George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net

1. Overview 2. The GameObject class  Important members  The IRenderable and ICollidable interfaces 3. The Block class 4. The IRenderer interface and ConsoleRenderer 5. The MovingObject and Ball classes 6. The IUserInterface and KeyboardInterface 7. The Engine class 2

Overview

4  Provides an API for a matrix-based game of Popcorn/Blockbuster  Important classes  GameObject – base class for objects in the game (like System.Object in C#)  IRenderer – interface for rendering objects  IUserInterface – interface for handling input  Engine – runs the game, checks for input and renders the scene  CollisionDispatcher – notifies objects of their collisions

Class Diagram

 Base class for all objects in the game world  Abstract class  There is no such thing as "just an object"  it's either a block, a racket or something else  Has a protected constructor  Implements the IRenderable interface  Provides a GetImage method – returns a char matrix for visualization  Used by the IRenderer – will be covered later 7

 Implements the IObjectProducer interface  Enables objects to produce other objects  Implements the ICollidable interface  Enables objects to participate and respond to collisions  The Update method  Abstract method  Inheriting classes implement their behavior there 8

 Other fields  TopLeft – top left coordinates of the object in the world  Represented by instance of MatrixCoords  body – defines the body of the object as a char matrix  IsDestroyed – property indicating if the object should be removed from the world 9

 Inherits the GameObject class  Describes a destructible block  Has implemented ICollidable methods  Note: all classes inheriting GameObject MUST implement the ICollidable methods if they need specific collision detection  Has a constructor, which initializes the body  1x1 char matrix with a symbol 11

 IRenderer – provides interface to methods for displaying IRenderable  EnqueueForRendering – adds a IRenderable to the rendering queue  RenderAll – flushes the rendering queue to the screen  ClearQueue – removes all objects from the rendering queue  Should be called after RenderAll  ConsoleRenderer – implements IRenderer for console display 13

 MovingObject – game object with a speed property  Speed is a vector  Represented by instance of MatrixCoords  Imagine "delta" coords – the change of TopLeft at each "turn"  Has overridden Update  Updates the TopLeft by adding Speed  Ball – inherits MovingObject with bouncing behavior  Overrides RespondToCollision 15

 IUserInterface – provides processing of user input  ProcessInput method – checks for user input and signals the appropriate events  OnActionPressed, OnRightPressed, OnLeftPressed  Events for action (e.g. "shoot" ), move left and move right (e.g. joystick left or keyboard left arrow)  KeyboardInterface – implements IUserInterface for keyboard interaction 17

 Manages game objects, user interface and visualization; all public methods are virtual  Uses a IUserInterface  Uses a IRenderer  Has several GameObject lists  allObjects  movingObjects  staticObjects  Has a separate Racket object  For control over the player racket  Has methods for controlling the Racket 19

 Important members  AddObject method – adds a GameObject to the engine  Run method – starts a "game loop":  Draws the scene  Checks for input  Clears the rendering queue  Calls Update for all objects  Calls ProduceObjects for all objects and collects  Removes all destroyed objects  Adds all produced objects 20

Questions?

1. The AcademyPopcorn class contains an IndestructibleBlock class. Use it to create side and ceiling walls to the game. You can ONLY edit the AcademyPopcornMain.cs file. 2. The Engine class has a hardcoded sleep time (search for "System.Threading.Sleep(500)". Make the sleep time a field in the Engine and implement a constructor, which takes it as an additional parameter. 3. Search for a "TODO" in the Engine class, regarding the AddRacket method. Solve the problem mentioned there. There should always be only one Racket. Note: comment in TODO not completely correct 4. Inherit the Engine class. Create a method ShootPlayerRacket. Leave it empty for now. 22

5. Implement a TrailObject class. It should inherit the GameObject class and should have a constructor which takes an additional "lifetime" integer. The TrailObject should disappear after a "lifetime" amount of turns. You must NOT edit any existing.cs file. Then test the TrailObject by adding an instance of it in the engine through the AcademyPopcornMain.cs file. 6. Implement a MeteoriteBall. It should inherit the Ball class and should leave a trail of TrailObject objects. Each trail objects should last for 3 "turns". Other than that, the Meteorite ball should behave the same way as the normal ball. You must NOT edit any existing.cs file. 7. Test the MeteoriteBall by replacing the normal ball in the AcademyPopcornMain.cs file. 23

8. Implement an UnstoppableBall and an UnpassableBlock. The UnstopableBall only bounces off UnpassableBlocks and will destroy any other block it passes through. The UnpassableBlock should be indestructible. Hint: Take a look at the RespondToCollision method, the GetCollisionGroupString method and the CollisionData class. 9. Test the UnpassableBlock and the UnstoppableBall by adding them to the engine in AcademyPopcornMain.cs file 10. Implement an ExplodingBlock. It should destroy all blocks around it when it is destroyed. You must NOT edit any existing.cs file. Hint: what does an explosion "produce"? 24

11. Implement a Gift class. It should be a moving object, which always falls down. The gift shouldn't collide with any ball, but should collide (and be destroyed) with the racket. You must NOT edit any existing.cs file. 12. Implement a GiftBlock class. It should be a block, which "drops" a Gift object when it is destroyed. You must NOT edit any existing.cs file. Test the Gift and GiftBlock classes by adding them through the AcademyPopcornMain.cs file. 25

13. Implement a shoot ability for the player racket. The ability should only be activated when a Gift object falls on the racket. The shot objects should be a new class (e.g. Bullet) and should destroy normal Block objects (and be destroyed on collision with any block). Use the engine and ShootPlayerRacket method you implemented in task 4, but don't add items in any of the engine lists through the ShootPlayerRacket method. Also don't edit the Racket.cs file. Hint: you should have a ShootingRacket class and override its ProduceObjects method. 26

14. * Bonus task (optional): Download JustBelot game source from (code commits are made often so be sure to always work on the latest game source). Write your own C# library called JustBelot.AI.YourBotName and write a class in it that implements JustBelot.Common.IPlayer interface. Implement your own AI belot player that will fight with other AI players. The winner will be awarded. Please send your players to and add them in the homework archive when you upload it. You are allowed to work in teams. This task is not obligatory. Discussions: here. 27