View this PageEdit this PageUploads to this PageVersions of this PageHomeRecent ChangesSearchHelp Guide

A Squeaky Introduction to Programming

(c) Lenny Pitt, 2005

GAMES 2005 link.
AIMS link

1. Introduction

Welcome
Special Note for Beginning Programmers
Special Note for Experienced Programmers

2. Getting Started

Setting up Squeak
First Run
Beginning Tutorials
  • painting, handles, car with joystick
Objects overview
  • Summarize basic tutorials, foreshadows what is to come.

3. Objects

[Prerequisites: We assume basic familiarity with Squeak etoys, namely, ability to paint and save sketches, or to drag items out of the supplies bin or object catalog, the understanding of most of the icons in the halo, how to bring up a viewer for an object, and the basic idea of writing a script to control an object.]

The Real World vs The Virtual World
What is an object
The Viewer
Properties and Variables
Simple Scripting
Tile Composition

4. Tests and Conditionals

Standard instruction on use of conditionals, introduce basic ones.
  • can test whether a property has a given value, and take an action as a result MouseAndCheeseDemo (Dave) Spend time dragging cheese this way and that while script ticking, discussing why things happen/don't. Stress concepts. In this script, note condition tests a value that changes within script.
  • example car stays on road. this tests for condition arising outside of script, or as a result of user behavior. color sides of road differently, use to decide whether to turn left or right.
  • discuss power of being able to test just about anything, and change just about anything as a result. test and if yes and .
  • several other small examples, perhaps some suggested by class.... real-time coding demo. whack-a-mole (test "under mouse" yes: setx random, sety random).
  • use color-changing ellipse if color=yellow, change to blue. if color=blue, change to yellow. What does this do? (have them figure out why it doesn't work, and stress importance of "thinking like computer" and stepping through a script yourself.
Change to nested test instead of independent test. When should you use one type and not another? Can we cycle through three colors? (Requires triple nest).

Nesting can be used to check "AND" condition.
Independent tests can be used to check "OR" condition.
TEST cond 1
YES stmt 1
NO
TEST cond 2
YES stmt 1
NO

General discussion.

  • can test whether a property has a given value, and change another property as a result
  • can test whether a property has a given value, and execute an arbitrary sequence of statements (or an entire script...) as a result
  • can test various conditions provided for by the squeak interface, including mouse events, keyboard events, "colorsees" and do whatever as a result.
  • Can combine tests to create "and" and "or" statements
  • Assignments and executions belong in the "yes" and "no" parts, booleans belong in the "test" part (this is enforced by squeak)

ENUMERATE HERE the different variety of tests available...
  • color sees
  • isOverColor
  • isUnderMouse
  • obtrudes
  • overlaps
  • overlaps any
  • value is true
  • value <, <=, =, ~=, >, >=, isDivisibleBy
  • can use math (but only on the right side of the comparison operator)

At this point there are enough tools to create lots of explorations. We saw some examples in class. The alarm clock didn't need anything more than the above. Introduce randomness, some of the math panes, and you can have a horse race. Make the car stay on the road.

This is an appropriate time to do the pong tutorial: Missing File (/cs498lbp/uploads/pong_tutorial_test.pr)

5. Exploring Squeak More Deeply

Introducing more panes, and supplies

6. User-defined Variables


7. More Advanced Scripting

Including more tests, sequencing, control, tickers, timers, delays, randomization.

8. Simulations

Use of variables to capture relationships.
Probably DON"T do this in the GAMES camp.

9. Programming Widgets (how-to's)

  • Lots of little pieces like scoreboxes, shooting stuff, bouncing, chasing, animation,...
  • This meant as resource for campers to overview, and use in constructing their games

10. Advanced Programming

  • Object oriented design. Development, Testing, Debugging.
  • Example Development of a more complex game.
  • Including object creation and deletion under program control, using menu items commands, multi-instance techniques, recursion, complex conditionals.

11. Complete Tour

Everywhere you want to be, and where you don't.

12. More Sections I Haven't Thought of Yet

Index


Notes and materials to be incorporated somehow.

For now I've dumped here random notes to myself, postings to a previous class, beginnings of "how-to" guides, etc. It needs to be sorted, spiffed up, revised, added to, and integrated into the book above.
Book Coverage and Ideas
Squeak Wish List
Squeak How-To
Squeak Troubleshooting
Squeak Other

(c) Lenny Pitt, 2005. Permission to use and reproduce for educational purposes only is granted, provided this notice is included, and no fee is charged other than to recover reasonable copying fees.


Links to this Page

  • notes-1-19 last edited on 26 January 2005 at 12:57:36 pm by dynpool-fern.cs.uiuc.edu
  • Course Information last edited on 27 January 2005 at 6:23:32 pm by dynpool-fern.cs.uiuc.edu
  • notes-3-09 last edited on 11 March 2005 at 9:10:52 pm by hh-1-213.flexabit.net
  • GAMES 2005 last edited on 12 August 2005 at 2:50:40 pm by dynpool-tantalum.cs.uiuc.edu
  • Discover Engineering last edited on 25 July 2005 at 5:54:58 pm by csil-cbt21.cs.uiuc.edu