Announcements: Reading materials are posted on Discussion Board.

Slides:



Advertisements
Similar presentations
Lesson One: The Beginning Chapter 2: Processing Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from built-in help reference.
Advertisements

Week 9: Methods 1.  We have written lots of code so far  It has all been inside of the main() method  What about a big program?  The main() method.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
Lesson One: The Beginning
Automating Practice Partner with Macro Express Donald T. Stewart, MD 2007User Group Meeting.
Recitation 1 Programming for Engineers in Python.
Java: Chapter 1 Computer Systems Computer Programming II Aug
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Art 315 Lecture 4 Dr. J. Parker AB 606 Today’s class: Programming! We are going to write some simple programs. We will use a tool called GameMaker –It.
Java: Chapter 1 Computer Systems Computer Programming II.
1 Agenda Administration Background Our first C program Working environment Exercise Memory and Variables.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
Using Visual Basic for Applications in Microsoft Project Sean Vogel.
CSD 340 (Blum)1 Using Visual Studio CSD 340 (Blum)2 Start/Microsoft Visual Studio 2005/Microsoft Visual Studio 2005.
IT Introduction to Website Development Welcome!
Applications Development
C++ / G4MICE Course Session 1 - Introduction Edit text files in a UNIX environment. Use the g++ compiler to compile a single C++ file. Understand the C++
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
11 Computers, C#, XNA, and You Session 1.1. Session Overview  Find out what computers are all about ...and what makes a great programmer  Discover.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Welcome to the Basic Microsoft Word Guide. Before you start this Guide, you will need to complete “Basic Computer”; “Basic Windows” and know how to type.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
MIS 3200 – C# (C Sharp)
C# Programming: From Problem Analysis to Program Design
Basic coding… with TouchDevelop!!
Chapter 2: The Visual Studio .NET Development Environment
Create a Halloween Computer Game in Scratch
Great way to learn is by example so fire up Visual Studios C (at home make sure you custom install with C++ - no longer default) by Deborah R. Fowler.
Lecture 2 D&D Chapter 2 & Intro to Eclipse IDE Date.
Scratch for Interactivity
Introduction to Python
BIT116: Scripting Lecture 06
Going Green By Ima Librarian
Introduction to Python
Goals Give student some idea what this class is about
An introduction to programming Created by Dr. Randy Pausch
Eclipse Navigation & Usage.
Introduction to Python
Barb Ericson Georgia Institute of Technology Dec 2009
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Announcements Mid-Term Exam!! Quiz 5 Again + Quiz 6 Exercise 5
Light Bot Solutions: an analysis
Announcement Function ppt: download again
How to Run a Java Program
Announcements How’s it going? My internet/power supply?
Digital Thinking: Animation, Video Games, and the Social Web
Testing and Repetition
Manipulating Pictures, Arrays, and Loops
Variables, Assignments Testing + Iteration
Summary of what we learned yesterday
Lawrence Snyder University of Washington, Seattle
Introduction to Python
Announcements How to save your work? Quiz solution 5/5/2019
Subject:Object oriented programming
Announcements: Questions: Names on the board? Why?
Basic Processing … Drawing pictures … It’s not art, it’s fun
Chapter 1 Introducing Small Basic
Digital Thinking: Animation, Video Games, and the Social Web
Computer Programming-1 CSC 111
Creating a Simple Game in Scratch
Announcements Survey feedback: summary Quiz: HW 7:
Agenda for Unit 5: Control Structures
Web Programming and Design
Navigating NEIU Blackboard 417 – 418a
Today: to list: Syllabus change: Grade on-line
How to Run a Java Program
Presentation transcript:

Announcements: Reading materials are posted on Discussion Board. Read: 1.Variables and 2.Operators How to process “language independent” explanations? Wednesday: meet in Lb1-222 Where is our Library building? Your Homework #2: Summary Homework #3 Solution 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Last week: Practice Abstraction with LightBot Quiz-2 Use Lightbot: Trivial Abstraction with LightBot: not so trivial? Fun? Quiz-2 Go over the solution! Now (and for the next little while): Today: Use C#/XNA: Tedious, but powerful! Next few lectures: Abstraction with C#/XNA: Fun Video Games! 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Questions? Wait for 1 minute 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Basic XNA … with C#!! Let’s do some gaming! Kelvin Sung University of Washington, Bothell (* Use/Modification with permission based on Larry Snyder’s CSE120 from Winter 2011) © Lawrence Snyder 2004

C# and XNA C#: From Microsoft, fairly new (less than 10 years old) Technical (geeky terms): An Object Oriented Programming Language Managed Language We don’t care!! Easy(ier) to learn:  We care! XNA: A Library of Functions!  remember these? For hobbyist to build their own Video Games! 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Development Support Campus Computer Lab: UW2-140 If you know what you are doing: Make sure your PC has a decent graphics card Support DirectX 9.0 and above (< three years old) Download and install: Visual C# 2010 Express: Download and run the installer (must have web-access) http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express Complete this before continue! XNA 4.0: Download and run the installer http://www.microsoft.com/download/en/details.aspx?id=23714 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Now download/compile: Practiced this as in-class Exercise-2 Unzip Watch out!! Double Click on ClassExample.sln Let’s look at some of the problems many of us encountered Go to course web-site: FAQ How to take the work home with you? Zip up and email Change zip extension! 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Visual C# 2010 Express 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

IDE questions: the FAQ Which IDE? Express vs. Professional? Cannot open the IDE What is I.D.E? Integrated Development Environmt The Solution Explorer and the source code file? Compile/Run and the Program Window Cannot run/edit problem Do you have line numbers on your editor? What other questions you have? 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Questions? Wait for 1 minute! 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Overview of the program Click to expand/hide #region and #endregion Functions: InitializeWorld() and UpdateWorld() Name: between void and () Body: between “{“ “}” 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Game Loop + Stuff Game Loop: Check out the “ClassExampleContent” InitializeWorld() once (and only once!!) UpdatesWorld(): continue to forever! Check out the “ClassExampleContent” Lots of images, audios! To Quit: Back-button on gamepad (or “F1” on your keybd) 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Game Pad to Keyboard mapping 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Make sense? What is the Game Loop? How do we communicate with our program using the keyboard? 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Parsing: Default Initialization Can we parse (read) this? /// and //  start of “comments”: Rest of the line is ignored by computer 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Variables … Declaring variables Variable names float and int (Case Matter!! Int not the same as int) const Variable names kBgAudioLevel IMPORTANT: CASE MATTER!! 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Functions … (from the library) Call Library functions, by its name with (): PlayBackgroundAudio() SetAppWindowPixelDimension() World.SetWorldCoordinate() Arguments: the stuff inside the parenthesis E.g., Arguments for PlayBackgroundAudio are: “BackgroundMusic” and kBgAudioLevel 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Coding is ALL detail!! All statements ends with: ; Case matter!! int defines an integer (0, 1, 2, -1, -2 …) Int or Integer are undefined Matches are important Open always matches with close ( and ) … or … { and } Code only goes into function body!! 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Make sense? From the Example from Exercise-2 Variables in UpdateWorld()? Function calls in UpdateWorld()? 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Background Color!! Let’s try … Changing the color of the background To whatever you like! How? … type this line: World.SetBackgroundColor(Color.White); Where should we put this line? 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Where to put the line of code? Talk to the person beside you! 3 minutes. Explain why 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

The Editor Auto-complete (Intellisense) Auto-Indentation Matching: Use: up/down arrow keys and <tab> key Auto-Indentation For formatting and readability Matching: When cursor at the one end of parenthesis or brace, match ones on the other end will show Color: Blue: Important (reserved/key) words Red: String, Green: Comments 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Error checking … Type something wrong … Error checking and error message: 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Scopes and Variables Namespace Scope Class Scope Function Scope 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Variables: Declare Inside “Class Scope” Outside “Function Scope” 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Add a “SoccerBall”! Scope of objects Observations: Notice: Declare circle above InitializeWorld/UpdateWorld “Visible” to both InitializeWorld and UpdateWorld Observations: Create a new object (circle) 25f vs 25 (Notice the “f”)! “SoccerBall”  what is this? Notice: Auto formatting (indentation) 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Now let’s move the soccerball! ThumbSticks.Right Gives a values between 0 to 1 In both X and Y (Vector2) Operators “=“ (assign), “+=“ (add-to-self-then-assign) Only works for “same data type” Same kinds of stuff (Vector2 vs floating point number) GamePad ButtonAClicked(), ButtonBClicked() ThumbSticks.Left 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

Things to try XNACS1Circle: data types and variables Vector2: Center GamePad.ThumbSticks float: CenterX, CenterY, Radius GamePad.ThumbSticks.Left.X bool (“true/false”): Visible GamePad.ButtonAClick() is a true/false Color: Color, LabelColor String: Label 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

More then one object? Can I create two circles? Without the soccer ball image (texture)? How can I control both of the circles? 2/16/2019 © 2010 Kelvin Sung, CSS, UWB

How to show off? (Screen Shot) To capture your game window: Move mouse into the Game Window and Click Alt+PrintScreen: to capture the window To save as a JPG image: Start Menu All Programs  Accessories  Paint Click on the “Paste” menu (or control-V) Save as: your favorite file name Send to all your friends!  2/16/2019 © 2010 Kelvin Sung, CSS, UWB