Assignment V: Animation

Similar documents
Assignment III: Graphical Set

Assignment II: Set. Objective. Materials

This assignment may be done in pairs (which is optional, not required) Breakout

CS 251 Intermediate Programming Space Invaders Project: Part 3 Complete Game

CSSE220 BomberMan programming assignment Team Project

Final Project. Stanford CS193p Winter 2013

Step 1 - Setting Up the Scene

Homework #3: Trimodal Matching

FAQ for City of Tacoma employees

2D Platform. Table of Contents

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

CS 211 Project 2 Assignment

Tutorial: Creating maze games

Assignment 3: Particle System and Cloth Simulation

understanding sensors

Experiment 02 Interaction Objects

Introducing Scratch Game development does not have to be difficult or expensive. The Lifelong Kindergarten Lab at Massachusetts Institute

Project 1: Game of Bricks

More Actions: A Galaxy of Possibilities

The Real Secret Of Making Passive Income By Using Internet At Your Spare Time!

Game Design. Level 3 Extended Diploma Unit 22 Developing Computer Games

CS193p Spring 2010 Monday, May 10, 2010

Space Invadersesque 2D shooter

First Tutorial Orange Group

In this project we ll make our own version of the highly popular mobile game Flappy Bird. This project requires Scratch 2.0.

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

Whack-a-Witch. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

Easy Input Helper Documentation

The Games Factory 2 Step-by-step Tutorial

Tutorial: A scrolling shooter

Ghostbusters. Level. Introduction:

G54GAM Lab Session 1

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

Programming Project 2

pla<orm-style game which you can later add your own levels, powers and characters to. Feel free to improve on my art

This Photoshop Tutorial 2010 Steve Patterson, Photoshop Essentials.com. Not To Be Reproduced Or Redistributed Without Permission.

A Beginner s Guide To Exposure

COMPUTING CURRICULUM TOOLKIT

For more information on how you can download and purchase Clickteam Fusion 2.5, check out the website

Photo Editing in Mac and ipad and iphone

Module 5, Lesson 1 Webinars That Convert Automated Planning Phase: The Automated Webinar Funnel

Maniacally Obese Penguins, Inc.

Senior Portfolio Instructions & Requirements Fall 2018

Math Matters: Why Do I Need To Know This?

GAME:IT Junior Bouncing Ball

1 Shooting Gallery Guide 2 SETUP. Unzip the ShootingGalleryFiles.zip file to a convenient location.

VACUUM MARAUDERS V1.0

15 TUBE CLEANER: A SIMPLE SHOOTING GAME

Photo Crush Day Four. dayfour

Project Marvin: A Social Networking Program for Android

Flappy Parrot Level 2

ZumaBlitzTips Guide version 1.0 February 5, 2010 by Gary Warner

Why Do We Need Selections In Photoshop?

The Deliberate Creative Podcast with Amy Climer Transcript for Episode #006: Creative Problem Solving Stage 3 - Develop

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

CSC242 Intro to AI Spring 2012 Project 2: Knowledge and Reasoning Handed out: Thu Mar 1 Due: Wed Mar 21 11:59pm

Taffy Tangle. cpsc 231 assignment #5. Due Dates

The following is an example script of how a complimentary call might run.

Show notes at: engineeringcareercoach.com/mentoring

Fingerpick Manual. Main Page

The Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? Objectives. Background (Pre-Lab Reading)

So you just want to light up an LED. What resistor should you use?

Final Project: NOTE: The final project will be due on the last day of class, Friday, Dec 9 at midnight.

Getting Started with the micro:bit

CISC 1600, Lab 2.2: More games in Scratch

GAME:IT Junior Bouncing Ball

Module 6: Coaching Them On The Decision Part 1

TELLING STORIES OF VALUE WITH IOT DATA

Custom Mobile App Support

ADVANCED COMPETITIVE DUPLICATE BIDDING

Spell Casting Motion Pack 8/23/2017

The Writer s Guide To Personal Branding BY TOM WARD

Clickteam Fusion 2.5 [Fastloops ForEach Loops] - Guide

A Scene from. From Last Day of School. A full length play. To read the whole play, free of charge, go to. Yourstagepartners.com

This little piece here I created is some of the scraps and then samples I was making for today s show. And these are wonderful for doing like

BE SURE TO COMPLETE HYPOTHESIS STATEMENTS FOR EACH STAGE. ( ) DO NOT USE THE TEST BUTTON IN THIS ACTIVITY UNTIL THE END!

Using Game Maker. Getting Game Maker for Free. What is Game Maker? Non-event-based Programming: Polling. Getting Game Maker for Free

Using Game Maker. Oregon State University. Oregon State University Computer Graphics

20 WAYS TO IMPROVE YOUR FINANCES IN UNDER 20 MINUTES

Game Making Workshop on Scratch

Cricut Design Space App for ipad User Manual

Chapter 1-Possibilities

Share My Design Space Project to Facebook or Pinterest?

Tommy s Revenge Trading Method 2.0 (Module 2 Part 1)

The Online Marketing Made Easy Podcast with Amy Porterfield Session #123

How to Quit NAIL-BITING Once and for All

1) How do I create a new program? 2) How do I add a new object? 3) How do I start my program?

First of all, I have my good friend, Rick Mulready, on the show today. He s back to talk about Facebook ads. Rick, how the heck are you?

Your First Game: Devilishly Easy

Introduction to Turtle Art

INTRODUCTION. Welcome to Subtext the first community in the pages of your books.

Tech Tips from Mr G Borrowing ebooks and Audiobooks Using OverDrive 3.2 on Apple ios Devices 2015

How Minimalism Brought Me Freedom and Joy

Unit 5: What s in a List

As can be seen in the example pictures below showing over exposure (too much light) to under exposure (too little light):

Would You Like Me To Personally Craft You A Customer Getting Masterplan That Will Get You Off The Income Roller Coaster... For Free?

Physics 2D Kinematics. Science and Mathematics Education Research Group

Discovering A Lucrative Niche!

Ten Years As A Five Figure A Month Writer And Habitual Idea Scribbler In The Internet Marketing Niche

Camera & Photos Apps ios10

Transcription:

Assignment V: Animation Objective In this assignment, you will let your users play the game Breakout. Your application will not necessarily have all the scoring and other UI one might want, but it will allow some customization of the game. Materials You must get this assignment working on an actual device, therefore you will need to be a member of a Developer Program (either the free University Developer Program or the $99/year normal Apple Developer Program). PAGE 1 OF 9

Required Tasks 1. Create a straightforward Breakout game using Dynamic Animator. See the image in the Screen Shots section below to get a general idea of the game, but your UI should not look exactly like the Screen Shot. Creativity is encouraged and will be rewarded. 2. When a brick is hit, some animation of the brick must occur. For example, the brick might flip over before fading out or it might flash another color before disappearing, etc. Show us that you know how to animate changes to a UIView. 3. In addition to supporting a pan gesture to move the game s paddle, you must support a tap gesture which pushes the bouncing ball in a random direction an appropriate (i.e. noticeable, but not game-destroying!) amount. 4. When all the bricks have been eliminated (or the game is otherwise over), put up an alert and then reset the bricks for the next game. 5. Your game should be designed to support at least 4 different variables that control the way your game is played (e.g. number of bricks, ball bounciness, number of bouncing balls, a gravitational pull, special bricks that cause interesting behavior, etc.). 6. Use a tab bar controller to add a second tab to your UI which contains a static table view with controls that let the user set these 4+ different variables to meaningful game-play values. Your game should start using them immediately (i.e. as soon as you click back on the main game play tab). 7. This game-play settings MVC must use at least one of each of the following 3 ios classes: UISwitch, UISegmentedControl and UIStepper (you may substitute UISlider for the UIStepper if that s more appropriate to your setting). 8. Your game-play configurations must persist between application launchings. 9. Your application should work on both iphone and ipad. It is up to you to decide what differences exist between the two platforms (if any). PAGE 2 OF 9

Hints 1. This assignment is intentionally vague about the feature set of your game to make room for you to show us some creativity. Being a good ios developer requires a lot of creativity in addition to the programming skills. 2. Don t overcomplicate the implementation of your Breakout game itself (you have plenty of other work to do in this assignment). 3. For example, to simplify things, the bouncing ball, the bricks and the paddle can all simply be filled-in rectangles (so you won t even need to subclass UIView for any of those things, just use UIView s backgroundcolor property). 4. It is highly recommended that you manage the collision behavior with the bricks using boundaries in a UICollisionBehavior rather than having those brick-drawing views actually participate in the collisions themselves. You ll have to keep the brick boundaries in sync with the frames of the bricks, but the bricks don t move once they are laid out for a given bounds of your MVC s View, so that should be very easy. This is only a hint, not a required task. 5. The bouncing ball, on the other hand, almost certainly does want to be a UIView that is participating in the collisions (with the brick, paddle and wall boundaries). That s because the bouncing ball is moving all over the place and you want the physics engine to be able to control its behavior. 6. The paddle, even though it moves in response to a pan gesture, probably also wants to be a boundary (one that you are constantly removing and adding to the UICollisionBehavior). Otherwise, when the ball hits the paddle, the paddle might want to move in response and it should only move in response to the pan gesture. 7. Note that the required tasks say nothing about keeping score. See Extra Credit. 8. You might find it good for the clarity of your code to create a BreakoutBehavior subclass of UIDynamicBehavior which uses addchildbehavior to add the collision behavior, dynamic item behavior, et. al., to itself. 9. Your BreakoutBehavior could manage lots of behavior-oriented stuff like the push, the brick and paddle boundaries, and the behavior of the bouncing ball(s). 10. It could even manage some of the UIViews that are syncing up with the boundaries (the paddle and bricks). Again, this is a hint, not a required task. 11. You probably won t want the reference view of your dynamic animator to be your MVC s top level view property. Because what happens when you want to put other UI around your game (e.g. score, etc.)? Do a little bit of architecting before you dive in to decide what code is going to be in your BreakoutBehavior, what code is going to be in your Controller, and what code might be in a UIView subclass. There are lots of acceptable solutions, but try to have a plan. PAGE 3 OF 9

12. Since the number of bricks is likely going to be configurable (i.e. not fixed), you will almost certainly be creating and adding the brick (and ball and paddle for that matter) UIViews in code rather than through your storyboard (that s one of the things this assignment is intended to give you experience doing). 13. You will find out about collisions between the bouncing ball and brick boundaries with the UICollisionBehavior s collisiondelegate. 14. When you add a boundary to a UICollisionBehavior, you get to pass along an identifier that will be fed back to you when the delegate gets notified of a boundary collision. That identifier is an NSCopying (i.e. an object that implements the NSCopying protocol). NSString and NSNumber both implement that protocol (and, because of bridging, that means you can pass a String or an Int, Double, etc.). But when that NSCopying is passed back to you in your collisiondelegate, you ll have to cast it from NSCopying to a String or NSNumber with as or as? in order to use it. 15. The push that your tap gesture must generate is just an instantaneous UIPushBehavior, nothing more. You ll have to set it up with an appropriate magnitude for the size of your bouncing ball. 16. The push behavior won t do any harm (other than wasting memory) if you leave it attached to the animator after it s done pushing, but removing it via its own action property would be better. Be careful to break any possible memory cycle using an unowned or weak capture list. 17. You can control things like the elasticity, friction, resistance and rotation of animated items using a UIDynamicItemBehavior instance. Simply create one, add any items to it that you want to have those attributes, then add the behavior to the animator. You can set/reset the attributes at any time. Be careful not to have multiple of these kinds of behaviors fighting to set the attributes of something that s being animated, though. 18. It s a little bit tricky to find out when the bouncing ball has left the game (either by getting past the paddle and falling off the bottom or by moving so fast that it jumps completely out of the boundaries yes, that can happen!). The place to detect this is probably in the action of your UICollisionBehavior. Just check in there to see if any of the items (the balls) being managed by the UICollisionBehavior are outside the bounds of the UICollisionBehavior s dynamicanimator s referenceview. If so, perhaps you could remove the item from the behavior (and also perhaps remove the UIView itself from its superview depending on how you are organizing your code). 19. You ll have to decide what to do with the ball when a game first starts or when a ball gets put back in play after going outside the bounds of the referenceview (or even what to do with the ball when autorotation happens). A simple thing to do is to place it right in front of the paddle. That way, when the user taps to push, most directions it would head will either go up toward the bricks or bounce right off the paddle and then shoot up there (and, if it is in the middle of moving and you PAGE 4 OF 9

autorotate, it ll either keep moving toward the bricks or a boundary or smash right into the paddle immediately and bounce off). 20. Speaking of autorotation, you ll probably want to position your bricks manually in viewdidlayoutsubviews (i.e. don t try to use autolayout for that). 21. Sometimes the physics of the ball and its collisions will leave the ball bouncing around somewhere where it s not ever going to get back to the paddle! That s okay, that s why the tap-to-push feature is a required task. It will get your user out of those conditions. 22. Some physics that you might set up might cause the ball to go completely crazy (i.e. accelerate to very high speeds or something). It s probably best to try to limit the user s ability to adjust game settings to mostly avoid these crazy situations. 23. Be careful not to move your paddle boundary right on top of a bouncing ball or the ball might get trapped inside your paddle. 24. Switching over to Settings in the middle of playing breakout will probably cause the ball to go out of play while you re away. That s fine, but see the Extra Credit for a better option. 25. You can feel free to put some other limitations on the use of your tap-to-push if you think this feature is too much like cheating (like maybe that feature is disabled for some amount of time after a brick is hit or it has a cooldown or something). 26. You might want to make the bezier path boundary for your paddle be an oval (even if the paddle itself still looks like a rectangle). It makes the bouncing ball come off the paddle more interestingly. 27. A fun configurable is having special bricks that, when hit, cause other things to happen. And nothing says that a brick has to disappear on the very first hit. 28. Don t ever put a UIView that is size (0, 0) into a behavior. It will not like that. 29. And don t ever add a behavior to an animator that is controlling the behavior of a UIView that is not in that animator s referenceview s view hierarchy somewhere. 30. If you ever have to move a UIView that the animator has a hold of, don t forget to call updateitemusingcurrentstate in the animator. 31. All behaviors know the dynamic animator that is animating them (they have a property to get it). 32. And all dynamic animators know the referenceview in which they are animating. 33. If you are in the habit of writing non-generic solutions to problems (i.e. you just keep typing until it does what you want!), you ll want to break that habit for this assignment because you want your solution to be as configurable as possible so that you can have more flexibility to create your game-play settings MVC. Hard-wiring the way things work internally in your classes will make that much harder. PAGE 5 OF 9

Screen Shot It is impossible to overemphasize how important it is to understand that this screen shot is not a Required Task. In fact, it s a Required Task to show some creativity and not just copy this. We rarely include screen shots because they bias you toward doing things in a certain way. That is not the intent of this screen shot. It is just here for those of you who feel like you absolutely cannot figure out what is being asked of you from a text description alone. So please don t submit a solution that looks exactly like this When bricks are hit, they disappear (in an animated way). The ball bounces around hitting bricks, the paddle, and the top and side walls (but falls through the bottom). Paddle moves horizontally only. PAGE 6 OF 9

Things to Learn Here is a partial list of concepts this assignment is intended to let you gain practice with or otherwise demonstrate your knowledge of. 1. UIDynamicAnimator 2. UICollisionBehavior 3. UIDynamicItemBehavior 4. UIPushBehavior 5. UIGravityBehavior 6. UIView animation (i.e. transitionwithview and/or animatewithduration) 7. Adding UIViews in code (rather than storyboard) 8. Gestures 9. NSUserDefaults 10. Closure memory cycle avoidance 11. UIAlertController 12. Static UITableView 13. UISwitch 14. UIStepper 15. UISlider 16. UISegmentedControl PAGE 7 OF 9

Evaluation In all of the assignments this quarter, writing quality code that builds without warnings or errors, and then testing the resulting application and iterating until it functions properly is the goal. Here are the most common reasons assignments are marked down: Project does not build. Project does not build without warnings. One or more items in the Required Tasks section was not satisfied. A fundamental concept was not understood. Code is visually sloppy and hard to read (e.g. indentation is not consistent, etc.). Your solution is difficult (or impossible) for someone reading the code to understand due to lack of comments, poor variable/method names, poor solution structure, long methods, etc. UI is a mess. Things should be lined up and appropriately spaced to look nice. Public and private API is not properly delineated. Often students ask how much commenting of my code do I need to do? The answer is that your code must be easily and completely understandable by anyone reading it. You can assume that the reader knows the SDK, but should not assume that they already know the (or a) solution to the problem. PAGE 8 OF 9

Extra Credit We try to make Extra Credit be opportunities to expand on what you ve learned this week. Attempting at least some of these each week is highly recommended to get the most out of this course. 1. Use sophisticated Dynamic Animation. For example, you might find a creative way to use the action method in a behavior or use something like linear velocity in your calculations. 2. As mentioned above, creativity will be rewarded, especially interesting game-play settings. 3. Keep score in your game. Give points for whatever you think makes sense, but hopefully playing more skillfully results in a higher score. 4. Do some cool artistic design in your user-interface (either by drawing or using images). 5. Pausing your game when you navigate away from it (to go to settings) is a bit of a challenge (because you basically have to freeze the ball where it is, but when you come back, you have to get the ball going with the same linear velocity it had). Give it a try. It s all about controlling the linear velocity of the ball. 6. Integrate the accelerometer into your application somehow (maybe real-life gravity affects the flight of the bouncing ball?). Check out the documentation for the CoreMotion framework. We will be covering CoreMotion later in the quarter, but this could still be a good exercise for practice learning something without benefit of a lecture explanation (good practice for your final project and maybe you even want to use CoreMotion in your final project and can t wait for it to get covered in lecture). Plus it s just kind of a cool feature in this app. PAGE 9 OF 9