CSE 114 - HW 5

CSE 114 - HW 5 - CSE 114 - HW 5 CSE 114 - Spring 2010...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 114 - HW 5 http://www.cs.sunysb.edu/~cse114/hw/HW5.html[4/13/2010 5:18:48 PM] CSE 114 - Spring 2010 Computer Science I Home Syllabus Schedule HW 5 - The Bouncy Boxes Game In lab we saw how games can use inheritance to customize AI for various types of bots. In this assignment we will make a game that uses inheritance to customize our responses to different types of collisions. Note that I am providing you with the following three classes which you should not change in any way: BouncyBoxesGame - This has our main method. Run this application to test your code. BouncyBoxesRenderingSurface - This class does much of the work of running the game, including rendering all game objects. CollisionManager - This class' static methods manage all game collision detection and resolution. Note that I don't expect you to understand how all of the code in the above three classes work. Certainly if you are interested in game development it would serve you well to try to learn as much as possible about what's happening, but much of the code found within is beyond the scope of this class. You will know all of this stuff by the time you complete CSE 219, but for this assignment, you'll focus on the box data management classes. So how does the game work? In this game, there is a little green box that the player can move around the screen. This is the player's box. There are two other types of boxes as well. There are 20 red boxes and 10 blue boxes, which move around on their own. When a player collides with a blue box, the blue box gets smaller. If the player collides with a blue box 3 times it disappears altogether. The player wins the game by making all the blue boxes disappear. If the player collides with a red box, the red box gets bigger, the player gets slower, and a more transparent green. When the player becomes fully transparent (appears white, same as background), the player loses. Note that in this game we will only be checking for collisions between the green-to-blue and the green-to-red boxes, not the red-to-blue boxes. Your BouncyBox Classes For this assignment, you must define four classes: BouncyBox PlayerBouncyBox GrowingBouncyBox ShrinkingBouncyBox It is a common approach in games to customize collision responses for various game objects using inheritance.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CSE 114 - HW 5 http://www.cs.sunysb.edu/~cse114/hw/HW5.html[4/13/2010 5:18:48 PM] The reason is that interactive, collidable game objects have many things in common in a game world. They typically each have their own position and velocity, for example, while having their own customized behavior. So, what game engines will do is pool together all the common attributes of collidable objects into an abstract
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

CSE 114 - HW 5 - CSE 114 - HW 5 CSE 114 - Spring 2010...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online