App Inventor Chapter 17 – Creating Animated Apps.

Slides:



Advertisements
Similar presentations
Creating posters and flyers Lesson -IV. Editing pictures inside Office Office 2007 has tools to edit photos and pictures in the document. Office 2007.
Advertisements

Understanding an Apps Architecture ASFA Computer Science: Principles Fall 2013.
Internet Applications Development Lecture 3 L. Obead Alhadreti.
Macromedia Director 8 Foundation Level Course. What is Director? Director is a challenging program for creating animation and multimedia productions for.
Games in AppInventor ASFA Programming I November 14, 2012.
Direction at your fingertips. A compass rose is a design on a map that shows directions. It shows north, south, east, west, northeast, northwest, southeast,
App Inventor Barb Ericson July 3, 2013.
Creating Mobile Apps with App Inventor! Day 4 Google search Kris Gordon Ludlow for links.
Sketchify Tutorial Graphics and Animation in Sketchify sketchify.sf.net Željko Obrenović
Document Layout. Creating Whitespace2 n Horizontal space –Within line of text –Netscape – – –If no room, will shorten the space to fit on current line.
Ch 14. Understanding an App’s Architecture Two perspectives 1.Programmer: a)Components & Behaviour b)Designed in Component designer Blocks editor 2.End-user:
What is Scratch? Scratch as Logo Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
2 What is pyGame? A set of Python modules to make it easier to write games. –home page: –documentation:
Pygame Dick Steflik.
Guide to Programming with Python
Game Design Creating a game called PING Phase 3: Steps for building basic game.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
CS 104 October 26, 2011 App Inventor. Agenda Discuss guest speakers Discuss quiz Finish Paint Pot Discuss concepts from Chapters 2 & 3 Mole Mash (if time.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
Introduction to TouchDevelop
Click your mouse for next slide Flash – Introduction and Startup Many times on websites you will see animations of various sorts Many of these are created.
Introduction to Scratch!
Game Maker Day 2 Making a Maze Game.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
1-1 OBJ Copyright 2003, Paradigm Publishing Inc. Dr. Joseph Otto Silvia Castaneda Christopher deCastro CSULA Macromedia Flash MX Introduction.
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
App Inventor MIT App Inventor.
XP Tutorial 1 Introduction to Macromedia Flash MX 2004.
Introduction to Flash. Topics What is Flash? What can you do with it? Simple animation Complex interactive web application, such as an online store. Starting.
Android Boot Camp for Developers Using Java, 3E
Two-Dimensional Motion and VectorsSection 1 Preview Section 1 Introduction to VectorsIntroduction to Vectors Section 2 Vector OperationsVector Operations.
Introduction to Scratch Scratch as Logo Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Spring /6.831 User Interface Design and Implementation1 Lecture 24: Animation HW2 out, due next Sunday look for your evaluation assignment on.
GAME:IT Helicopter Objectives: Review skills in making directional sprites Create objects that shoot and destroy for points Create random enemies on the.
Game Maker Terminology
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Game Maker – Getting Started What is Game Maker?.
Shooters in GameMaker J Parker.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Overview of Game Maker. Game Maker Version 7.0 Lite (free version) For MS-Windows platforms
Computer Programming Modeling a Passive Solar Home.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 3 Designing the Interface with Layout Managers.
GAM666 – Introduction To Game Programming ● DirectDraw, the 2D component of DirectX, uses the term “surface” to mean an area of memory in which pixel data.
Lesson 5 – Repetition / Loops
How to create a basic game in Scratch. The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high x increasesx decreases.
The animation which I am proposing here will be a 2D animation and can be developed in JAVA or Flash. 0.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
TIME TO MAKE OUR FIRST INTERACTIVE SPRITE! LAST WEEK WE WERE MAKING SPRITES, or simple PIXELATED Graphics of our favorite CHARACTERS. Feel free to spend.
Introduction to Game Programming & Design III Lecture III.
Animation in flash. Frame-by-Frame Animation An animation is made from a series of framed images displayed one after the other to create the motion. Flash.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Introducing Scratch Learning resources for the implementation of the scenario
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Introduction to Programming and App Inventor. Introduction What is a computer program? Introducing App Inventor Getting hands on with App Inventor.
Introduction to App Inventor 2 ASFA AP CS Principles
MOM! Phineas and Ferb are … Aims:
Lesson 5-2 AP Computer Science Principles
Understanding an App’s Architecture
Chapter 16 – Programming your App’s Memory
Creating Animated Apps: Canvas與ImageSprite 靜宜大學資管系 楊子青
Image #1 Getting Started
CSC 221: Introduction to Programming Fall 2018
Animation Translation.
Presentation transcript:

App Inventor Chapter 17 – Creating Animated Apps

From introduction: This chapter discusses methods for creating apps with simple animations - objects that move. You’ll learn the basics of creating two-dimensional games with App Inventor and become comfortable with image sprites and handling events like two objects colliding.

The illusion of animation On all display devices animation is achieved by providing a succession of still images or ‘frames’ with the ‘moving’ object(s) appearing in each frame slightly displaced from the previous frame. ‘Flipping’ through the images at a rate of about 12 fps or higher gives the illusion of the objects being animated. Most current display devices present frames at 30 fps in the US (25 fps in Europe). Interesting factoid: your local movie theater goes at only 24 fps!

App Inventor tools for animation In App Inventor you will place ‘Ball’ and ‘ImageSprite’ components in a ‘Canvas’ to achieve 2-D animation Start by adding a Canvas component to the Component Designer. Set its ‘Width’ to ‘Fill Parent’. Set ‘Height’ to something reasonable (leaving room at the bottom for other components) – say 300 pixels.

The Canvas coordinate system

Start with Canvas.PaintColor to choose a color. Example: Paint on Canvas with DrawLine & DrawCircle This colors a single pixel blue. Where on the screen does it do this? What controls the fact that is only one pixel?

Ball and ImageSprite components Besides painting pixels you can define and use Ball and ImageSprite components Ball and ImageSprite components can only ‘live’ somewhere on a Canvas component. A ‘Ball’ is one particular kind of ImageSprite. It is always round and you can only vary its size and color. ImageSprites are based on actual JPGs or PNGs or GIFs.

Using Timers to animate components This is a common way to do animation. Later, we’ll see how you can use a component’s.Speed and.Heading methods to control animation. In Component Designer, drag out a Clock component and set its TimerInterval property. A TimerInterval set to 1000 = 1 second; 500 = ½ a second, 100 = 1/10 th of a second, 10 = 1/100 th of a second, 1 = 1/1000 th of a second, or one millisecond. Drag out a Clock.Timer event in the Blocks editor. Whatever actions specify inside the Clock.Time will be performed at whatever TimerInterval you have set.

Creating Movement Example (moves ball horizontally across screen): Does the ball move to the left or to the right? What two settings control how fast the ball moves? What if you wanted to move the ball vertically instead of horizontally?

What’s the difference? Suppose we set a TimerInterval of 1000 and a MoveTo command of X+200 Then we set a TimerInterval of 100 and a MoveTo command of X+20 Which moves faster or slower? Which moves more smoothly?

What does this block do?

Collision detection and EdgeReached App Inventor uses high-level ‘algorithms’ to figure out when two ImageSprites might have collided with one another or when an ImageSprite encounters the edge of the screen. Good thing; otherwise you would have to come up with that logic yourself which ain’t easy to do!

What do these blocks of code do? This change made to correct an error in the book

Particular edges In the example, if the ball encountered any edge, the code sends it back to (1,1). There is a parameter that can distinguish among the edges – it takes the following values: North = 1 Northeast = 2 East = 3 Southeast = 4 South = -1 Southwest = -2 West = -3 Northwest = -4

CollidedWith and...

... NoLongerCollidingWith

There may be a particular ‘Other’... This is a block that refers to a particular component as a whole, rather than specific properties of a component

Interactive Animation One technique: use a button-click to switch Timer.Enabled ‘On’ and ‘Off’ But this is just a ‘one-way’ switch. We need more sophisticated behavior. Take a look at this next slide....

More sophisticated button behavior...

Sprite animation without a clock timer (.Heading and.Speed) Take a look at this:

This code will control.Heading (How??)