Objects, Functions and Parameters

Slides:



Advertisements
Similar presentations
What to expect in Grammar/Writing 2 By AJ Brown (Rev by Kit)
Advertisements

Unified Modeling Language Philip Liew
Bilingual Dictionaries
CS1061 C Programming Lecture 2: A Few Simple Programs A. O’Riordan, 2004.
Conversational Computers
Greater than or equal? A lesson on math language A lesson on math language.
Let’s talk about text positioning All about the text block This diagram shows a server with connectors leading to other computers. Notice the position.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Introduction to TouchDevelop
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 8 Fall 2010.
Programming Languages V Deena Engel’s class.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
Project One---Starting Your Business Business Equipment.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Getting a handle on ActionScript A basic primer for non-programmers.
The ‘game’ is played by 12 players and 2 Accountants. The accountants and the first player can volunteer. Other players Are chosen as the game progresses.
The Language of Mathematics Basic Grammar. A word to the wise The purpose of this tutorial is to get you to understand what equations and inequalities.
VB Games: Preparing for Memory Brainstorm controls & events Parallel structures (again), Visibility, LoadPicture, User-defined procedures, Do While/Loop,busy.
CH 8 : Enhancing Classes - Review QUICK REVIEW : A Class defines an entity’s (Object’s) data and the actions or behaviors (Methods) associated with that.
CoderDojo Roscommon. Today's Ninja Challenge: Create a GhostBuster Game Like This.
Week 1 – Beginners Content McAfee & Big Fish Games CoderDojo.
Computer Basics Lesson 2 Using Windows and the Start Menu 1.
Using Action Buttons in Microsoft PowerPoint Creating a PowerPoint Jeopardy Game By Aaron Driscoll.
Adjective Groups and Phrases Grammar & Language. 1. I don’t know much about this topic. 2. I know a little about this topic. 3. I know a bit about this.
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Using the Dictionary You can build your vocabulary by using the dictionary.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
If the same piece of code needs to be used several times we can use a loop – but only if those times are all together. If you need to run the same bit.
Nonvisual Arrays by Chris Brown under Prof. Susan Rodger Duke University June 2012.
[b]- A big black bear sit on a big black rug [ ʃ ]- She sells seashells on the seashore.
Word Study in Practice What does it look like?. Sorts “I hear and I forget, I see and I remember, I do and I understand” Are the heart of Word Study because.
Think of a sentence to go with this picture. Can you use any of these words? then if so while though since when Try to use interesting adjectives, powerful.
JAVA CLASSES, METHODS AND VARIABLES.  Defined Noun: A set or category of things having some property or attribute in common and differentiated from others.
Gadgets Module 5 Lesson 2 By I. Kukushkina. We should: 1.Learn how to write cinquains; 2. Plan a short report about favourite gadgets.
Susan Ibach | Technical Evangelist Sage Franch | Microsoft Student Partner.
Syntax- the object study. What is syntax?  Syntax is the study of the structure  of sentences.  Syntax analyzes how words combine to form sentences.
Communicating between objects MESSAGE PASSING. CHALLENGE Can YOU do WHACK a MOLE in less than 5 minutes?????
Sage Franch | Technical Evangelist Susan Ibach | Technical Evangelist.
Susan Ibach | Technical Evangelist Sage Franch | Technical Evangelist.
Martin Norris Computing Teacher/Leader at Moldgreen Community Primary School, Huddersfield
Formal Languages and Automata FORMAL LANGUAGES FINITE STATE AUTOMATA.
Susan Ibach | Technical Evangelist Sage Franch | Technical Evangelist.
Broadcasting (Adding a new level)
UNIT 2 – LESSON 6 ENCODE AN EXPERIENCE.
GENERAL OOPs CONCEPTS.
Muybridge Lab CSD 340 (Blum).
Sphero CPD 9.30 – 11am Introduction to Sphero 11 – 11.15am
Our Presentation is about Microsoft word
Microsoft® Small Basic
Object-Oriented Design
Memory Matching Challenge
Graph Paper Programming
Lesson 6: User Input and Strings
HAPPY NEW YEAR! Lesson 7: If-statements unplugged
Remembering lists of values lists
Explain what touch develop is to your students:
2.2 Notes What is the difference between speed and velocity?
Functions Christopher Harrison | Content Developer
How to save information in files open, write, close
Training & Development
The coordinate system Susan Ibach | Technical Evangelist
Compare the words you found for homelearning with a partner
Quiz: Computational Thinking
“”Building Bridges” and “The Right words at the right time”
Comparatives Game.
How to read from a file read, readline, reader
Detecting collisions Susan Ibach | Technical Evangelist
Working with dates and times
Presentation transcript:

Objects, Functions and Parameters Susan Ibach | Technical Evangelist Sage Franch | Microsoft Student Partner

Mastering a few key concepts will allow you to understand your code! Objects Functions Parameters Properties

Objects

An object is a representation of something in a game or app Set lives in the game to 1. noun object Examples of objects we use in code include A button A character in our game The game itself Grammar is different depending on language.

What objects do we have in our game? obstacle hero board game

Functions

A function is an action associated with an object Set lives in the game to 1. verb function Functions allows us to Manipulate the object (make it bigger, smaller, faster) Create new objects (add text or a picture to the board) Perform an action (start a timer, end the game, remove a life) Grammar is different depending on language.

Different objects have different functions Functions on the game object: Functions on the hero object: This is only a few of the functions!

Objects and Functions in our game

What are those symbols? Indicates the function being called for this object Indicates that this is a “special” object, with LOTS of functions.

Parameters

A parameter is a value passed to a function Set lives in the game to 1. parameter Parameters allow you to control what a function will do How big to make an object How fast to make an object move How many points to score Grammar is different depending on language.

Not all functions accept parameters Sometimes functions just perform a specific action and you don’t need to provide extra information Some functions don’t take parameters. Some of what you see here are “properties” on objects. Properties will come later.

Some functions return an object Some functions, like set life(), just do something Like change the number of lives in a game But some functions, return something… This function returns an object. We are storing the returned object in a variable called board. (Board can have its own functions and properties!)

Think of functions that return objects as vending machines…

Or…

Properties

Properties give us information about our objects How big is our hero? width or height How many lives does the game have left? life How fast is our hero moving? speed

We can change the value of a property by calling a function and passing in a parameter Change the size of our hero set width(100) or set height(100) Change the number of lives in our game set life(3) Change the speed of our hero set speed(400)

Resize our hero & Change number of lives in the game

Your challenge Resize your hero Set number of lives in your game to a value of your choosing

Congratulations! You can speak code.

Vocabulary and concepts Object: A self-contained entity that includes both functions and data (properties). An object in code is like a noun in a sentence. Function: A procedure or routine that does a specific task. A function in code is like a verb in a sentence. Some functions just do something, but some return an object Parameter: A value (or variable) that is passed to a function. Property: An attribute of an object A property is like an adjective in a sentence