BallBounce: A simple game app



Similar documents
BallBounce: A simple game app

App Inventor Beginner Tutorials

TalkToMe Part 2: Shaking and User Input

MIT App Inventor Getting Started Guide

App Inventor Tutorial 4 Cat & Mouse Game

Creating Animated Apps

PaintPot. Figure 2-1. The PaintPot app

Schoolwires Staff Website Reference Guide

CHAPTER 1 HelloPurr. The chapter covers the following topics:

What You ll Build. CHAPTER 3 MoleMash

Setting up Wireless ipad Control of your DEWETRON Computer-based System

Working with SQL Server Integration Services

Hello Purr. What You ll Learn

App Inventor Drum Machine Instructions (Project #1) (Version 2 of App Inventor) Description:

Understanding Files and Folders

Flash MX Image Animation

Website Builder Overview

Mobile Apps with App Inventor

Appendix 1 Install RightNow on your PC

Named Memory Slots. Properties. CHAPTER 16 Programming Your App s Memory

Create a Google Site in DonsApp

How To Configure Using Different Clients

Aurasma: Creating from Web

Create a new file/canvas to work with by going to the file menu and selecting new.

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

Google Sites. How to create a site using Google Sites

RVC3000 User Guide VERSION 1.2. Vytru, Inc. 0

TalkToMe: A beginner App Inventor app

Android Programming Family Fun Day using AppInventor

MAKE YOUR FIRST A-MAZE-ING GAME IN GAME MAKER 7

Microsoft Expression Web Quickstart Guide

Pro/E Design Animation Tutorial*

Tutorial: Using Get Response to Add an Opt-In Box to Your WordPress Site

DESIGN A WEB SITE USING PUBLISHER Before you begin, plan your Web site

Mobile App Tutorial Animation with Custom View Class and Animated Object Bouncing and Frame Based Animation

Getting started 7. Designing interfaces 27

Installing Remote Desktop Connection

App Inventor Tutorial 11 QR Code Reader

Vizit 4.1 Installation Guide

Outlook basics. Identify user interface elements that you can use to accomplish basic tasks.

MAKE AN A-MAZE-ING GAME

How a Teen can use "Budget" to manage their money

From Data Modeling to Data Dictionary Written Date : January 20, 2014

CHAPTER 14 Understanding an App s Architecture

Config Guide. Gimmal Smart Tiles (SharePoint-Hosted) Software Release 4.4.0

How to move to your account with MAC Mail

2. More Use of the Mouse in Windows 7

Business Objects Version 5 : Introduction

TimeBillingWindow. User guide 2014

Fruit Machine. Level. Activity Checklist Follow these INSTRUCTIONS one by one. Test Your Project Click on the green flag to TEST your code

QClaims Launch Instructions for Windows

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

Salesforce Administrator s Installation Guide

System Preferences is chock full of controls that let you tweak your system to how you see fit.

Affiliation Security

DIA Creating Charts and Diagrams

Microsoft PowerPoint 2010 Handout

Scientific m-learning. 4-7 June Mobile Application Development using App Inventor for Android Devices

Xylophone. What You ll Build

Microsoft PowerPoint 2010 Computer Jeopardy Tutorial

6. If you want to enter specific formats, click the Format Tab to auto format the information that is entered into the field.

Virto SharePoint Gantt Chart App for Office 365 Release User and Installation Guide

Your Guide to the All New, Drag & Drop, Mobile-Responsive Builder

Steps for using MagicConnect

Managing your Windows 7 Task Bar and Start Menu

PowerPoint 2007: Animation Learning Guide

Creating Fill-able Forms using Acrobat 8.0: Part 1

Wellesley College Alumnae Association. Volunteer Instructions for Template

Windows 8 Features (

Create a Poster Using Publisher

Create an Art Collage

OWA User Guide. Table of Contents

Installing Java 5.0 and Eclipse on Mac OS X

White Noise Help Guide for iphone, ipad, and Mac

SiteBuilder 2.1 Manual

Introduction to Windows 8

Time Entry User Guide

History Explorer. View and Export Logged Print Job Information WHITE PAPER

Using the Drag-and-Drop Report Builder

REDUCING YOUR MICROSOFT OUTLOOK MAILBOX SIZE

Representative Console for Android Phone. Version 2.1

Quick Start Tutorial Imperial version

WebPlus X7. Quick Start Guide. Simple steps for designing your site and getting it online.

Making a Website with Hoolahoop

ZoomText 10.1 for Windows 8 Quick Reference Guide Addendum

NDSU Technology Learning & Media Center. Introduction to Google Sites

Evoluent Mouse Manager for Windows. Download the free driver at evoluent.com. The primary benefits of the Mouse Manager are:

Your No-Nonsense Guide to Facebook Ads

Most of your tasks in Windows XP will involve working with information

OET Cloud Services Getting Started Guide

Oracle BIEE 11g Reports and Dashboard Hands On

Managing Your Desktop with Exposé, Spaces, and Other Tools

Introduction to dobe Acrobat XI Pro

Fioptics TV App. User Guide

1. After installing you can launch the program by clicking on the Start button and then select Programs, then WS_FTP LE, and then WS_FTP LE.

Creating and Using Links and Bookmarks in PDF Documents

Making a Poster Using PowerPoint 2007

How to Configure Windows 8.1 to run ereports on IE11

User Tutorial on Changing Frame Size, Window Size, and Screen Resolution for The Original Version of The Cancer-Rates.Info/NJ Application

LCD MONITOR TOUCH PANEL DRIVER 2 OPERATION MANUAL. for Mac. Version 1.0 PN-L703A/PN-70TA3/PN-L703B/PN-70TB3/PN-L603A/PN-60TA3/PN-L603B/PN-60TB3

Transcription:

BallBounce: A simple game app In this tutorial, you will learn about animation in App Inventor by making a Ball (a sprite) bounce around on the screen (on a Canvas). Start a New Project If you have another project open, go to My Projects menu and choose New Project. BallBounce: A simple game app - 1

Name the Project Call it something like "BallBounce". Remember, no spaces. But underscores are OK. Add a Canvas From the Drawing and Animation drawer, drag out a Canvas component and drop it onto the viewer. BallBounce: A simple game app - 2

Set the Screen so that it does not scroll The default setting for App Inventor is that the screen of your app will be "scrollable", which means that the user interface can go beyond the limit of the screen and the user can scroll down by swiping their finger (like scrolling on a web page). When you are using a Canvas, you have to turn off the "Scrollable" setting (UNCHECK THE BOX) so that the screen does not scroll. This will allow you to make the Canvas to fill up the whole screen. BallBounce: A simple game app - 3

Change the Height and Width of the Canvas to Fill Parent Make sure the Canvas component is selected (#1) so that its properties show up in the Properties Pane (#2). Down at the bottom, set the Height property to "Fill Parent". Do the same with the Width property. BallBounce: A simple game app - 4

Add a Ball Now that we have a Canvas in place, we can add a Ball Sprite. This can also be found in the Drawing and Animation drawer. Drag out a Ball component and drop it onto the Canvas (#1). If you'd like the ball to show up better, you can change its Radius property in the Properties pane (#2). Open the Blocks Editor. BallBounce: A simple game app - 5

Open the Ball1 Drawer to view the Ball's blocks. Drag out the Flung Event Handler Choose the block when Ball1.Flung and drag-and-drop it onto the workspace. Flung refers to the user making a "Fling gesture" with his/her finger to "fling" the ball. Fling is a gesture like what a golf club does, not like how you launch Angry Birds! In App Inventor, the event handler for that type of gesture is called when Flung. BallBounce: A simple game app - 6

Set the Ball's Heading and Speed. First get the setter blocks. Open the Ball drawer and scroll down in the list of blocks to get the set Ball1.Heading and set Ball1.Speed blocks BallBounce: A simple game app - 7

Plug the set Ball1.Speed and set Ball1.Heading into the Fling event handler Set the Ball's speed to be the same as the Fling gesture's speed Mouse over the "speed" parameter of the when Ball1.Flung event handler. The get and set blocks for the speed of the fling will pop up. Grab the get speed block and plug that into the set Ball1.Speed block. BallBounce: A simple game app - 8

Set the Ball's heading to be the same as the Fling gesture's heading Do the same for the Ball's heading. Mouse over the heading parameter and you'll see the get heading block appear. Grab that block, and click it into the set Ball1.Heading block. BallBounce: A simple game app - 9

Test it out A good habit while building apps is to test while you build. App Inventor lets you do this easily because you can have a live connection between your phone (or emulator) and the App Inventor development environment. If you don't have a phone (or emulator) connected, go to the connection instructions and then come back to this tutorial. (Connection instructions are in Tutorial #1 or on the website under "Getting Started".) Why does the Ball get stuck on the side of the screen?! After flinging your ball across the screen, you probably noticed that it got stuck on the side. This is because the ball's heading has not changed even though it hit the side of the canvas. To make the ball "bounce" of the edge of the screen, we can program in a new event handler called "When Edge Reached". BallBounce: A simple game app - 10

Add an Edge Reached Event Go into the Ball1 drawer and pull out a when Ball1.EdgeReached do event. BallBounce: A simple game app - 11

Go back into the Ball1 drawer and pull out a Ball.Bounce block. Add the edge value for the Ball.Bounce block The Ball.Bounce method needs an edge argument. Notice that the Ball1.EdgeReached event has an "edge" as a parameter. We can take the get edge block from that argument and plug it into the call Ball1.Bounce method. Grab the get edge block by mousing over (hover your mouse pointer over) the "edge" parameter on the when Ball1.EdgeReached block. BallBounce: A simple game app - 12

Your final blocks should look like this. Now test it out! BallBounce: A simple game app - 13

Test it out! Now, when you fling the ball, it should bounce off the edges of the canvas. Great job! There are many ways to extend this app. Here are some ideas... but the possibilities are endless! - Change the color of the ball based on how fast it is moving or which edge it reaches. - Scale the speed of the ball so that it slows down and stops after it gets flung. - Give the ball obstacles or targets to hit - Introduce a paddle for intercepting the ball, like a Pong game Visit the App Inventor website to find tutorials that help you extend this app, particularly the Mini Golf tutorial. Have fun with these extensions, or others that you think up! BallBounce: A simple game app - 14