(An Introduction for Programmers)

Slides:



Advertisements
Similar presentations
Understanding an Apps Architecture ASFA Computer Science: Principles Fall 2013.
Advertisements

CS0004: Introduction to Programming Introduction to Programming.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Game Programming and Scratch (Lecture 1) Game Programming and Design Brooklyn College Bridges To Computing.
Introduction to Scratch UC Santa Cruz CMPS 10 – Introduction to Computer Science 13 May 2011.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Game Mathematics & Game State The Complexity of Games Expectations of Players Efficiency Game Mathematics o Collision Detection & Response o Object Overlap.
Introduction to Alice Basics : What is Alice? Object Oriented Definitions What Does it Look Like? Where Can I Use it?
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Game Programming Using Scratch. Scratch Scratch is an IDE (Integrated Development Environment) that allows users to create and run simple graphics/games.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Introduction to Programming and Visual Basic
C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Comparing Python and Visual Basic
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Chapter Introduction to Computers and Programming 1.
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
A First Program Using C#
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
Binary There are only 10 types of people in the world, those who understand binary and those who don't.
There are only 10 types of people in the world, those who understand binary and those who don't.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
111 © 2002, Cisco Systems, Inc. All rights reserved.
CMPD 434 MULTIMEDIA AUTHORING Chapter 06 Multimedia Authoring Process IV.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Computer Concepts 2014 Chapter 12 Computer Programming.
Visual C++ Programming: Concepts and Projects
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
Introduction to Programming G50PRO University of Nottingham Unit 2 : Introduction To Scratch Paul Tennent
Summer Computing Workshop.  This workshop is designed to introduce basic programming concepts through the use of the highly intuitive programming environments.
I Power Higher Computing Software Development Development Languages and Environments.
CS 3050 Object-Oriented Analysis and Design. Objectives What is “Object-Oriented?” Object-Oriented Approach Vs. Structured Approach How Has the Object-Oriented.
Game Programming Using Scratch Brooklyn College Bridges To Computing (2009) M. Meyer, J. Rodney.
Chapter 1 Introduction Visual Basic.NET. Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi 2 Objectives Explain what Visual Basic is Contrast.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
Introduction to Programming Using Scratch Brooklyn College Bridges To Computing (2009) M. Meyer.
Using Alice.  Alice is visual  Alice is object-oriented (some might say object- based)  Alice eliminates the need to debug syntax errors  Alice introduces.
Introduction to Game Programming & Design III Lecture III.
Chapter 1: Introduction to Computers and Programming.
Introducing Scratch Learning resources for the implementation of the scenario
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
Introduction to Programming and App Inventor. Introduction What is a computer program? Introducing App Inventor Getting hands on with App Inventor.
Development Environment
What is it?! •Scratch is a programming language that allows you to create interactive stories, music, animations, art, games, and more!
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
Computer Software: Programming
Event-driven programming
Understanding an App’s Architecture
Introduction to Programming Using Scratch
Computer Programming.
Introduction to Object-Oriented Programming
Social Media And Global Computing Introduction to Visual Studio
Learn… Create… Program
Learn… Create… Program
MICCA SCRATCH Workshop
ICT Gaming Lesson 2.
Introduction to Snap Programming
Learn… Create… Program
Learn… Create… Program
Presentation transcript:

(An Introduction for Programmers) Game Programming and Scratch (An Introduction for Programmers) M. Meyer

Programming Languages Allow us to "talk" to a computer, in a language that we can understand. Computers only understand binary (0,1). Modern (high-level) languages allow us to write code in a way that we understand. Require a well-defined syntax and semantics: Syntax -> Refers to the rules of grammar, word order and punctuation that must be used. A "syntax error" is usually a punctuation error. Semantics -> Refers to the meaning of words that are included in a language. Some words have set meanings, others can be changed (variable mouseX).

Programming Languages Allow us reuse and share code. No need to create code to handle mouse input if someone has already created a function to do that. A library is a collection of functions and variables that can be reused when creating a new program. Fall into different paradigms (types): Functional, Logical, Imperative, Procedural and Object-Oriented approaches to programming.  If you already know one language of a particular type it's easier to learn other languages of that same type. Note: This is true for spoken languages as well. If you know Spanish it's easier to learn French, Portuguese or Italian. All these languages use similar vocabularies (semantics) and almost the same grammar (syntax).

Scratch Scratch is an IDE (Integrated Development Environment) application. An IDE is a program that allows users to create, run and debug other programs.   Users create programs in Scratch using an imperative, procedural, object-oriented programming language that has very simple syntax*.  * Don't worry, all of these terms will be made clear to you.

Scratch Interface

Why use Scratch? Scratch is FREE! Simple development environment. Simple syntax. Large library of functions. Supports the basics of programming in 3 important paradigms. Can be used to create ANY simple computer game.

1. Scratch is FREE Scratch is developed by the Lifelong Kindergarten group at the MIT Media Lab, with financial support from the National Science Foundation, Microsoft, Intel Foundation, Nokia, and MIT Media Lab research consortia. Scratch is free software and will run on Windows, Mac and Linux machines. You can download Scratch here: http://scratch.mit.edu/ The Scratch website has many helpful tutorials as well as a forum for asking questions and getting help.

2. Simple Development Scratch requires very little typing in order to create programs.  Visual code creation using drag & drop. FAST FAST FAST development.

3. Simplified Syntax No missing semi-colon problems. Code blocks can only fit together in pre-defined way.

4. Large library. Over 100 predefined functions and limited ability to make more. Functions cover vast majority of things that you would want a sprite (object) to be able to do in a game.

5. Basics of Programming Just like spoken languages programming languages can be categorized into certain types (or paradigms). 3 of the most popular programming paradigms are: Imperative -> A 'smart' list. Procedural -> Making phone calls. Object Oriented -> Programming with objects.

A. Imperative Programming "a smart list" The imperative paradigm is like giving the computer a list, which tells it step-by-step what to do. To be "smart" your list needs 3 things: Sequence -> A predefined order in which to process information. (English vs. Hebrew) Selection -> The ability to make a choice. The "IF" statement. Repetition -> The ability to repeat an action. The "WHILE" statement.

i. Sequence All "scripts" processed from top down. 4 possible start conditions, 3 end.

ii. Selection If, If-else and wait_until functions.

iii. Repetition Variety of functions including repeat_until.

B. Procedural Programming "making phone calls" The procedural programming paradigm is based upon the concept of the “procedure call”: the ability to “send a message” to another section of a program. Procedural programming allows us to create sections of code that can be reused over and over .

Broadcast Scratch allows users to send "broadcasts" which can activate other scripts who are listening for a particular broadcast.

C. Object-Oriented OO programming is an extremely important programming paradigm. Scratch is not true OO programming, but good example of basic concepts:  Creating programs that are composed of interacting objects. These objects have associated properties and functions.

Object-Oriented (cont) Objects in Scratch are called "Sprites". Properties of Sprites include: Location Look User defined properties (variables). Functions of Sprites include: Move  Make Sound Detect Collision

Sprites Found in the lower right corner of the screen. Click on them to select them and change contents of main window.

6. Create ANY simple game. At this time Scratch does not support Vector Graphics, Multi-threading, and library creation. Despite these restrictions it is still possible to create some very interesting and exciting applications/games with Scratch. ANY simple arcade game or older console game can be recreated in Scratch. Many simple browser-based games (Flash) can also be emulated with Scratch.

Game State All games consist of a sequence of states. Each state is characterized by a combination of visual, audio and/or animation effects, as well as a set of rules that are being applied.  

Object State Objects in the game proceed through their own states as well. These states are defined by the behavior and functionality applied at that time.

Game State in Scratch At typical game in Scratch might use the following state transition diagram.

Object State in Scratch In a typical game in Scratch, all of your normal sprites (not stage or any control sprites like buttons) will work very well with only 4 scripts. These scripts (and any associated variables) will control the objects state.

Example Games

More example games http://scratch.mit.edu/users/MrMeyer Note: With an account you can post your own games and projects on the Scratch website. (http://scratch.mit.edu/) http://scratch.mit.edu/users/MrMeyer Additional labs, tutorials and templates can be found by going to the “Bridges Program” website and examining the “Game Programming and Design” lesson-plan: http://bridges.brooklyn.cuny.edu/collegenow/modules/11_GameProgDesign/GameProgDesign.html

The End