Mike Reilly wrote:
Thanks Ron, I think you've found my wavelength (as fluctuating as it
might be). I agree on that patterns would be awesome to teach, as
early as they can conceive what an object is.
The book "Objects First" by Kolling is my inspiration for doing this,
it's aimed at the right level. Take a game apart, understand the
objects, understand the classes that make them up, tweak the classes,
build some classes, inheritance, etc.
I like the coding techniques that are used in the patterns. It does show
how a lot of functionality can be produced with minimal code by
intelligent use of objects.
I am not sure that I would teach them as "Patterns". I would just use
the patterns as examples of how to get things done. It is nice that they
have names and "everyone" knows what you mean when you say "decorator"
but I am not sure that the names are as important as knowing how to get
things done well.
Patterns are not separate from OOP, they are just best practices for
using OOP in an intelligent way.
The "Head First Design Pattern" book is very good in this regard and the
examples are very short and use entertaining examples that everyone can
understand - make a duck quack and fly - then throw in a rubber duck and
see how little it takes to modify the duck objects to deal with squeaky,
non-flying ducks.
Their Decorator pattern makes a nice introduction into the power of
objects which is a lot more concrete than a whole discussion about the
theory.
The examples are in Java so you have to make some small adjustments and
you probably want to give them a MovieClip to draw on rather than a
console to write on so your standard "main" test program will be different.
If you are going to try to use games in Flash as the theme, you want to
walk them through the Listener pattern early on since you will need this
one to avoid a real mess in handling user events.
I'll also take a look at Sandy, 3D would be so cool!
If you have the time (I'm assuming you don't, so no pressure), could
you teach me about how I would use intervals for something like a
simple Paddle class in Pong? Just something for KeyListeners, to move
the paddle object.
Use events to find out about user inputs. Keys being released means the
user wants something done.
Use intervals to generate events that are time related (wake up every
1/x of a second to move the ball.) When you wake up, check the state of
things, do what needs to be done (move the ball, update the clock or
timer, ) and set a new interval.
You can also do these things when the user presses a key, just cancel
your pending interval and set a new one.
If you use the Listener pattern it gets very easy to add functions to
the list of things that need to get done when the central event handler
wakes up or responds.
This is one of the first lessons I would like to
get across, using a "class" from the Library of a movie for two
"instances". After Pong I was going to move toward Space Invaders, to
throw in Arrays and reinforce the class -> objects relationship.
<rant>Teach them about arrays of objects. Don't let them put anything
else in an array. It would be nice to find a bunch of programmers that
are surprised to find out that you can put numbers in an array rather
than the current case where the opposite is true and people create
horrible messes of parallel, multidimensional arrays when an array of
objects would be much clearer and require a lot less code and infinitely
less debugging time. </rant>
Thanks again!
Mike
On 8/19/07, Ron Wheeler <[EMAIL PROTECTED]> wrote:
You might also want to look at Sandy.
It is a 3D engine for Actionscript.
Very easy to build 3D applications that might be fun for the kids.
Check out Script_in_Action forum for resources and links.
Mike Reilly wrote:
Thanks so much to all of you for such quick responses. I'm sure my
students will benefit from many of the links that you've already sent.
Since I'm not the best at clarity when writing, I'll throw out what
started this thinking. I read Andy Harris' "Beginning Flash Game
Programming For Dummies", and I think the level of that book was
awesome for intro. I have also been using Greenfoot.org as a
supplement to teach Java, as kids love games whether it's intro or
more advanced (remember, these are 14-17 year olds, and we're trying
to generate an interest in programming).
So this semester I'll be trying to develop an OO approach, using
Actionscript (can't install anything else without formal district
approval). Some of the resources forwarded should be very helpful,
and I truly appreciate all support.
I'll be reading Moock's "Essential ActionScript 2.0", combining it
with Harris' "Dummies", to create "Essential Games for Dummies"!
On a serious note, how do you get an "enter_frame" event handler to
work inside an AS file?
It works but you shouldn't use it . Look at using intervals.
Try not to teach bad programming practices to kids at that age.
You might also want to read "Heads Up Design Patterns" just to find out
the "right" way to do many things. It is oriented to Java but all
relevant to ActionScript.
Ron
Thanks again, I won't bother you all much more. Please take a look at
last year's kids work: www.nghsit.com/studyhall
Mike
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com