IMGD 2900 Digital Game Design I Class 2: Thursday 11.01.

Slides:



Advertisements
Similar presentations
Introduction to Programming
Advertisements

Introducing JavaScript
Javascript Code Quality Check Tools Javascript Code Quality Check Tools JavaScript was originally intended to do small tasks in webpages, but now JavaScript.
IMGD 2900 Digital Game Design I Class 1: Thursday
IMGD 2900 Digital Game Design I Class 4: Monday
IMGD 2900 Digital Game Design I Class 5 Monday
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 2: Your First Program.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 8: JavaScript I.
Information Technology Center Hany Abdelwahab Computer Specialist.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Functions Part I.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
CIS101 Introduction to Computing Week 12 Spring 2004.
Graphics and Multimedia In visual Studio. Net (C#)
Please open your laptops, log in to the MyMathLab course web site, and open Quiz 2.6/7. You will have access to the online calculator on your laptop during.
Debugging JavaScript CS346. IE Javascript Debugging Aids From IE6 on default: no debugging aid for Javascript Change setting: – Tools > Internet Options.
A First Program Using C#
JS Arrays, Functions, Events Week 5 INFM 603. Agenda Arrays Functions Event-Driven Programming.
Javascript and the Web Whys and Hows of Javascript.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
Using Styles and Style Sheets for Design
Programming with JavaScript (Chapter 10). XP Various things Midterm grades: Friday Winter Career Fair – Thursday, April 28, 2011 (11 am to 3 pm). – MAC.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
Using Moodle This is a rough draft of instructions for teachers to use Moodle in lieu of the in- service that is held periodically. Call me if you need.
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Getting a handle on ActionScript A basic primer for non-programmers.
Digital Stories Using Microsoft Photo Story 3 for Windows Carrie Roth (248)
Create Your Own Webpage. Today’s Class Internet Safety & Privacy Tables Embedding music and video Frames.
 HTML is hypertext markup language. It is a way for people to display their information with more complex pictures and text displays. Before HTML, messages.
IMGD 2900 Digital Game Design I Class 12: Thursday
USING UNITY JAVASCRIPT. CONVENTIONS AND SYNTAX IN JAVASCRIPT Case Sensitivity All keywords like var or function must be in lowercase. All variable names,
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
IMGD-2900 Digital Game Design I Class 7 Monday
1 CS161 Introduction to Computer Science Topic #9.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
Advanced Topics Lecture 8 Rachel A Ober
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
What is ? ●It is a Halton District School Board term ●It is HDSB use of Google Apps for education. It includes: ■ Google Docs ■ Google Drive ■ Google Applications.
PHP (cont.). 2 Functions Definition – function name(arguments){... } –syntax name as for a variable, but without $ arguments as for variables –to return.
Logical Operators.  Quiz  Let's look at the schedule  Logical Operators 2.
Debugging No readings. 2 What's The Proper Indentation? function max(x,y) { if (x
Functions in C++ Top Down Design with Functions. Top-down Design Big picture first broken down into smaller pieces.
JavaScript 101 Lesson 6: Introduction to Functions.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
C++ Programming Basics C++ Lecture 1 Stacy MacAllister.
Programming games Show work on site. Work on slide show. Timed event for bouncing ball. Homework: [Finish slide show and upload to site.] Acquire a short.
© 2010 Robert K. Moniot1 Chapter 6 Introduction to JavaScript.
Algebra using brackets
HTML Basics.
Project Objectives Publish to a remote server
Learning to Program D is for Digital.
Unit C: Expressions Lesson 03: Mathematical Properties with Variables
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Exploring JavaScript Ch 14
T. Jumana Abu Shmais – AOU - Riyadh
Programming in JavaScript
Tutorial 10 Programming with JavaScript
Programming in JavaScript
Workshop for Programming And Systems Management Teachers
Presentation transcript:

IMGD 2900 Digital Game Design I Class 2: Thursday 11.01

Today’s topics Reporting bugs Toys! More about Perlenspiel Assignment 04 Prototyping, designing puzzles

Reporting bugs Always include the exact text of any error messages, either from the Perlenspiel message box, from Aptana or Firefox

Toys!

Perlenspiel Introduction to more features

Other bead properties PS.BeadColor ( x, y, rgb ) PS.BeadGlyph ( x, y, glyph ) PS.BeadShow ( x, y, flag ) PS.BeadAlpha ( x, y, alpha ) PS.BeadBorderShow ( x, y, flag ) PS.BeadBorderColor ( x, y, rgb ) PS.BeadBorderAlpha ( x, y, alpha ) PS.BeadGlyphColor ( x, y, rgb ) PS.BeadFlash ( x, y, flag ) PS.BeadFlashColor ( x, y, rgb ) PS.BeadData ( x, y, data ) PS.BeadAudioFile ( x, y, audio ) PS.BeadAudioVolume ( x, y, volume ) PS.BeadAudioLoop ( x, y, flag ) PS.BeadFunction ( x, y, f )

Using PS.ALL PS.BeadColor ( PS.ALL, 0, PS.COLOR_RED ); PS.BeadGlyph ( 0, PS.ALL, “P” ); PS.BeadAlpha ( PS.ALL, PS.ALL, 50 );

The setters are also the getters! var rgb = PS.BeadColor ( x, y, (opt) rgb ); var g = PS.BeadGlyph ( x, y, (opt) g );

Using the grid PS.GridSize ( width, height ) PS.GridBGColor ( rgb ) PS.GridLineWidth ( width )

Using color 1. Use color constants PS.COLOR_RED; 2. Use PS.MakeRGB () PS.MakeRGB ( 255, 0, 0 ); 3. Use hexadecimal notation 0xFF0000

Using color well kuler.adobe.com

Meet the clock Find: PS.Init = function () { "use strict“; // change to the dimensions you want PS.GridSize ( 8, 8 ); // Put any other init code here };

Meet the clock Add: PS.Init = function () { "use strict“; // change to the dimensions you want PS.GridSize ( 8, 8 ); PS.Clock (60); };

Meet the clock Find: PS.Tick = function () { "use strict"; // Put code here to handle clock ticks };

Meet the clock var Count = 6; PS.Tick = function () { "use strict"; Count -= 1; if ( Count < 1 ) { PS.Clock(0); PS.StatusText( "Liftoff!" ); } else { PS.StatusText("Count: " + Count); } };

Using Aptana Studio Download and install latest version of Mozilla Firefox (16.0.2) Disable auto-update of Firefox add-ons Download / install Firebug 1.9.2b1 Download / install Aptana Studio 3 This adds Aptana Debugger to Firefox Enable JSLint in the Aptana editor Google “Aptana JSLint” for instructions Know the power of the Dark Side

Doug Crockford Formerly of Lucasfilm Games Creator of JSLint, JSMin, JSON Author of Javascript: The Good Parts The nanny of Javascript coding style

About coding style Compiler doesn’t care if your code looks good But Uncle Crock does! Clean, consistent, well-commented code is easier to read, debug Clean, consistent, well-commented code is more valuable to you, collaborators and employers Many employers enforce code style

Use a global namespace for all game variables and functions Capitalize names of global vars/functions Use ALL CAPS for constants Use suggestive var/function names Comment liberally // Global namespace variable var G = { // Constants MAX_ZOMBIES: 32, // Variables ZombieCnt: 3, // active zombies BulletCnt: 11 // bullets left };

Choose a bracketing style and use it consistently if ( G.Foo > 31 ) { PS.StatusText( “Out of bullets!” ); } if ( G.Foo > 31 ) { PS.StatusText( “Out of bullets!” ); } G.KillRobot = function ( ) { G.Score += 1; PS.StatusText( “Score: “ + G.Score ); };

Always use brackets to delineate statement blocks if ( !G.WearingArmor ) G.HitPoints -= 1; if ( !G.WearingArmor ) G.HitPoints -= 1; if ( !G.WearingArmor ) { G.HitPoints -= 1; }

Always use parenthesis to delineate multiple conditions if ( G.BulletCnt < x - 1 && !G.AmmoWarned ) { G.AmmoWarned = true; PS.StatusText(“Out of bullets!”); } if ( (G.BulletCnt < (x – 1)) && !G.AmmoWarned ) { G.AmmoWarned = true; PS.StatusText(“Out of bullets!”); }

Keep all local variable declarations at the top of a function definition if ( hp < 1 ) { var dead = true; } var dead; if ( hp < 1 ) { var dead = true; }

Don’t use ++ or -- syntax += and -= are more explicit and easier to change while ( i < len ) { G.BlowAwayZombie(i); i++; } while ( i < len ) { G.BlowAwayZombie(i); i += 1; }

About coding style Sloppy code is discouraging Well-styled code is a pleasure and encourages improvement Games are made of code Take pride in your workmanship

Today’s vocabulary Puzzle

What is a puzzle? Play = Superfluous action Toy = Something that elicits play Game = Toy with a rules and a goal

What is a puzzle? Play = Superfluous action Toy = Something that elicits play Game = Toy with a rules and a goal Puzzle = A game with a solution

Assignment 04: Prototype a puzzle Prototype a puzzle with Perlenspiel Journal as you design and code Post it before class on Monday Bring to Monday’s class

Objective 1: Prototype a puzzle with Perlenspiel This is a rough pass – don’t polish! Must meet definition of a puzzle Must be for a single player Must be replayable Must work without breaking Must be self-documenting Must be named

Objective 2: Journal as you design/code Document your creative process Ideas, code fragments, sketches Journals will be inspected

Objective 3: Post your puzzle before class on Monday Put a link on your team web site Make sure the link starts the puzzle Make sure it runs without crashing

Objective 4: Bring prototype backups to Monday’s class Use flash drives Make sure both team members bring it

Questions? Next class: Monday Come ready to playtest your puzzle!