Add for next time:
- We can cover the return value of TryParse, and should.
- LOOK AT THE LESSON 09 INSTRUCTOR NOTES ABOUT MONOGAME
AND THE OPENAL ERROR!!!
|
PCE feedback:
- Game stuff, generally
- "It's complicated" - I wonder if this is because we're
jumping to later exercises?
- More info on debug mode in order to test the program
quickly?
- Multiway If/else
- Directions are tricky - I think there's too many ball/block
combinations?
- Maybe a clear 'vision' ("there's three types of balls -
fire, ice, normal. Here's what they do") plus a chart?
- It's not clear where the code should go - people keep
modifying stuff outside the area
- Make it clear by specifying nested if/else, maybe
putting the skeleton inside?
- The 'unrevealed' thing caused a lot of problems - remove it?
Describe it better?
- Logical Ops
- Directions are tricky - I think there's too many ball/block
combinations?
- Maybe a clear 'vision' ("fire balls remove ice blocks",
and vice-versa) combined with a chart of some kind?
- Add code for stuff that isn't really the focus of the
exercise?
|
Exercises from prior quarters
From earlier
-
Exercise:
String Basics
(Sect. 16.2) (Hand-In) (You may want
to use this exercise as a springboard for posting questions /
answers (to the Google group) about how to make good use of
online help, both on the Internet, and inside Visual Studio's
online help system. REMOVE VS's HELP
- REMOVE THIS
ENTIRELY?
-
Exercise:
Read through
the SimpleIf
tutorial
(Required)
- This
will show
you some of
the basic
aspects of
the API for
the game (API
= functions
you can call
to make
things
happen in
the game),
and show a
very simple
usage of an
if
statement.
- Note
that many of
the game
tutorials
may contain
links to
explanation
videos.
You are NOT
required to
watch any of
the game
videos,
although you
may find it
useful to do
so.
Note that
the
tutorials
specify how
long each
video is
(what the
duration is)
so you know
how long the
video will
be before
you start
watching.
- Note that
the code
samples in
the game
tutorials
use Java
instead of
C#.
You'll
notice that
there's a
table
labeled
'Warning:
Language
Differences'
which will
tell you to
replace
Java's
KeyEvent.VK_SPACE
with C#'s
Keys.Space,
for example.
While the C#
project
correctly
uses C#, you
will need to
fix any code
that you
copy-and-paste
from the
tutorial
into your
program.
- While
you will use
the
knowledge
you gain
from this
tutorial in
future
exercises,
there is
nothing that
you are
required to
hand in for
this
tutorial.
- For this
exercise you
are required
to post
something to
the 'Did you
get the
'BlockBreaker'
game to work
in PCE 02? '
discussion
group.
You need to
post one of
two things:
- A
quick
post
saying
"Yes, I
got it
to
work",
or
- A
post
saying
"No, it
didn't
work".
You must
include
the
version
of
Windows
that
you're
running
(ex:
Windows
7)(Ex:
Mac +
Parallels
with
WIndows
7),
which
version
of
Visual
Studio
you have
installed
(look
for it
in
Help->About
if
you've
forgotten),
and
whether
you
successfully
installed
XNA 4.0
or not.
- If
you
posted
this
already
(in
Lesson
01) you
do NOT
need to
post
this
again
-
EXTRA CREDIT:
The
following items
are NOT required
for this course.
Successfully
completing them
will earn you as
much as 5 ponts
of extra credit
(total)
-
EXTRA
CREDIT:
Exercise:
Read through
the
SimpleIfWithTravelingBall
tutorial
(Required)
- This
will show
you how to
make the
ball bounce
off the
paddle and
off the
edges of the
screen.
- The
notes about
the game
tutorial
videos and
the
tutorials'
usage of
Java vs. C#
is still
relevant to
this
tutorial.
These notes
won't be
mentioned
again after
this
tutorial.
- While
you will use
the
knowledge
you gain
from this
tutorial in
future
exercises,
there is
nothing that
you are
required to
hand in for
this
tutorial.
-
EXTRA
CREDIT:
Exercise:
Read through
the
IfElseMultiway_WithBlocks
tutorial
(Hand-In)
- This
will show
you how to
make the
ball bounce
off the
paddle and
off the
edges of the
screen.
- You need to complete
exercise #1.
- For
this and
all
future
exercises,
please
do
whatever
exercise
is
linked
to even
if the
text of
the
above
link
doesn't
agree
with the
exercise
that the
link
actually
goes to.
In other
words,
if the
above
link
says
"exercise
#1" but
the
following
the link
takes
you to
exercise
#2 then
please
do
exercise
#2.
(And
please
post a
mesage
to the
course
discussion
forum so
the
instructor
knows to
fix it -
thanks!)
- Do
all the
work for
this
exercise
by
modifying
the C#
starter
project
for this
tutorial
(the
link to
the
project
is on
the
tutorial
page,
near the
top).
Note
that
this
project
is
different
than the
starter
project
for the
prior
tutorials
so you
will
have to
download
it.
- You
will
specifically
need
to
modify
the
Game.cs
file.
- In
order to
hand
this in
you will
need to
find the
Game.cs
file
(and
ONLY the
Game.cs
file) for
this
tutorial
(located
in
CSharp.zip\BlockBreaker\BlockBreaker\BlockBreaker)
and then
copy it
into a
folder
named
IfElseMultiway_WithBlocks
inside
folder
that you
will
submit
for
grading
(by
.ZIPping
that
folder).
Note
that the
starter
project
for this
week
already
has a
folder
with
that
name,
and a
text
file
with a
note
making
it clear
that you
should
put the
Game.cs
file
there.
-
EXTRA
CREDIT:
Exercise:
Read through
the
LogicalOperators_WithBlocks
tutorial
(Hand-In)
- This
will show
you how to
make the
ball bounce
off the
paddle and
off the
edges of the
screen.
- You need
to complete
exercise #1.
- Do
all the
work for
this
exercise
by
modifying
the C#
starter
project
for this
tutorial
(the
link to
the
project
is on
the
tutorial
page,
near the
top).
Note
that
this
project
is
different
than the
starter
project
for the
prior
tutorials
so you
will
have to
download
it.
- You
will
specifically
need
to
modify
the
Game.cs
file.
- In
order to
hand
this in
you will
need to
find the
Game.cs
file
(and
ONLY the
Game.cs
file) for
this
tutorial
(located
in
CSharp.zip\BlockBreaker\BlockBreaker\BlockBreaker)
and then
copy it
into a
folder
named
LogicalOperators_WithBlocks
inside
folder
that you
will
submit
for
grading
(by
.ZIPping
that
folder).
Note
that the
starter
project
for this
week
already
has a
folder
with
that
name,
and a
text
file
with a
note
making
it clear
that you
should
put the
Game.cs
file
there.
- As
you
can
see,
the
way
you'll
submit
your
game-related
work
follows
a
standard,
easy-to-follow
format.
Thus
there
will
be
no
further
instructions
specifying
where
to
put
things
for
future
exercises.
-
Exercise:
Getting ready for
the next
lesson's video-game based programming:
download, compile,
and run the Match3 game. (Required)
This link takes
you to the
tutorial page
for the Match3
game (which
we'll be using
in next week's
lesson) - make
sure that you
can download and
compile the
game, and make
sure that you've
played the
finished game
enough that you
understand (at
least basically)
how the game is
played. Note that there's nothing to hand-in for this exercise.
-
|
Feedback / Improvements on exericses:
(Please ignore this - these are notes for myself for the
next iteration of this course) |
PUT SOMETHING EXPLAINING THAT THE
PREVIEW VIDEO FILE NAMES != THE LINK TEXT ABOVE; THE ORDER IS THE
SAME, BUT THE NAMES ARE VERY, VERY DIFFERENT
TODO:
Move the first line in the ICEs forwards
Redo voting:
-
While Loops
-
For Loops
x1 Student
questions not as
clear as in
others
-
Do-While Loops
-
Increment (++)
and decrement
(--) operators
-
Compound
operators (+=,
*=, etc)
-
Random Numbers:
Seed Values
x3 Redo: This could
be much shorter
(a couple
sentences rather
than several
mintues) x3
-
Random Numbers:
the
.Net-specific
.Next(min,
maxPlusOne)
method
x1 Questions at
end
-
Random Numbers:
Seed Values &
non-random
numbers
-
Random Numbers:
Using the plain
.Next() &
modulus ( % )
-
Basic Parameters
x1 The
difference
between Call
Stack and Stack
Frame is
difficult to
understand. Also
- call stack vs.
stack
-
Basic Return
Values x3:
Rushed at the
end? x2
|
SpaceSmasher:
A note about finding subprojects:
The
project
for this
is
inside
the .ZIP
starter
project
for this
week.
When you
open the
.ZIP
you'll
see a
folder
named
Normal_Console_Project.
Inside
there
you
should
see the
Visual
Studio
Solution
file
(named
"PCE_02").
Double-click
on that
solution
file and
VS
should
open the
normal
"Console-based"
project
correctly.
("Console"
refers
to that
window
that
appears
when
you're
doing
Console.WriteLines
and
.ReadLines)
adsf
-
Exploring Conditional
Statements With
The SpaceSmasher
Game:
Setting Up
SpaceSmasher
This
section will
show you how we
might apply the
conditional
statements to
improve
"SpaceSmasher" a
fun, 'block
breaker' style
game.
-
VIDEO:
Here's a
short (45
second)
video
showing the
overall
style of the
game -
more-or-less
how it's
played, how
it looks,
and what it
sounds like.
(You do NOT
need to
outline this
video - just
watch it,
get a feel
for what the
game is
supposed to
be, and be
happy that
you've now
gotten
college
credit for
watching a
YouTube
video :)
)
-
Late
breaking
change
(2:40pm
on
10/6/2014):
If you
want to
play the
finished
version
of the
game
please
extract
the
starter
project's
.ZIP
file,
then
open up
the
Example
Solution
folder,
then
double
click on
the
SpaceSmasherCSharp.exe
file.
As long
as
you've
got
OpenAL
and .Net
installed
then
this
should
allow
you to
run the
video
game
yourself.
-
VIDEO:
How To Get
The Visual
Studio
Project To
Compile And
Run
-
Exercise:
Get the
Visual
Studio
Solution for
the game
installed
and running
-
If
you're
working
on your
own
computer
then
you're
going to
need to
install
OpenAL
using
this
installer.
You will
need
administrator
privileges
but the
installation
itself
is
extremely
small
and
quick
(it only
copies
two .DLL
files
into
your
system
directory)
-
OpenAL
is
already
installed
on
the
computers
at
Cascadia
-
you
do
NOT
need
to
install
OpenAL
on
the
school
computers
(including
the
VMWare
Views)
-
The
game
itself
is
inside
the .ZIP
for the
starter
project
for this
week -
inside
the .ZIP
you'll
see a
folder
named
SpaceSmasher_Game_Project.
Inside
that is
anther
folder,
named
SpaceSmasher
(just
SpaceSmasher
- ignore
the
folder
named
SpaceSmasherLib).
Inside
that
you
should
see the
Visual
Studio
Solution
file
(also
named
"SpaceSmasher").
Double-click
on that
solution
file and
VS
should
open the
game
project
correctly.
-
Note:
Your
instructor
has
opened,
compiled,
and
run
this
project
using
the
"Visual
Studio
Express
2013
For
Windows
Desktop"
version
of
VS.
This
project
probably
will
not
work
on
earlier
versions
of
VS
(although
it
might
-
try
it
but
don't
waste
more
than
5
minutes
on
if
it
doesn't
work).
It
*should*
work
in
the
Pro
version
of
VS
2013,
but
your
instructor
hasn't
actually
tried
it
in
that
version.
-
At
this
point
you
should
be able
to use
the
"Start
Without
Debugging"
option
(under
the
"Debug"
menu) to
launch
the
game.
As
always,
if you
run into
trouble
then you
should
try to
fix it
on your
own for
5-10
minutes.
If that
doesn't
work
then
post a
clear
description
of your
problem
to the
disccussion
group
and
resume
trying
to fix
it.
If you
can't
fix it
in 20
minutes
or so
then
please
go on to
the next
step
(and
just do
the best
you
can).
afads
-
Exploring Conditional
Statements With
The SpaceSmasher
Game:
Tutorial Topics
All of
the following
exercises are
from
the 'Conditionals
Lab'
document.
I will keep
refering to the
'Conditionals
Lab' document
but will not
link to it to
avoid people
asking if all
the links
actually go to
the same
document or not.
They all refer
to the above
link.
-
Exercise:
Warmup With
Single If
Statements
Within the
'Conditionals
Lab'
document,
find the
section with
the title
"Warmup With
Single If
Statements"
(this is on
or near page
3).
Write out
the C# code
that best
expresses
the English
written on
each line
(which are
numbered 1
through 8).
Please put
your answer
into the MS
Word file
named
"Warmup With
Single If
Statements.docx"
(which is
already in
the starter
project .ZIP
file)
-
VIDEO:
Warmup
Exercises
-
Exercise:
Work Through
The 'Lab
Exercises'
Document
Within
the
'Conditionals
Lab'
document,
work through
the
following
exercises.
NOTE: There
are a lot of
exercises
marked as
"Hand In"
here, but
the document
walks you
through
pretty much
all of them
almost
step-by-step.
-
NOTE:
The
video
talks
about
"ExampleSolution.cs"
which
was
removed
after
the
videos
are
recorded.
If you
want to
see an
example
solution
follow
the
instructions
in
3.A.I,
above
-
Topic:
The
Single
If
-
VIDEO:
Spawning
the
ball
when
the
user
presses
the
space
bar
-
Exercise:
TODO 0:
Single
Ifs to
Spawn
Balls
Near
Paddles
(Hand-In)
Note:
Once
you're
done
the
ball
will
spawn
just
above
the
paddle,
then
move
downwards
through
the
paddle
and
off
the
screen.
Later
you
will
change
the
game
so
that
the
ball
bounces
off
the
paddle
instead.
Remember,
the
detailed
description
of
this
exercise
(and
all
the
other
exercises
in
this
section)
are
located
in
the
'Conditionals
Lab' document
-
Topic:
The
Single
If
Exercise:
TODO 1:
Single
Ifs for
Paddle &
Ball
Collisions
(Hand-In)
(There
is no
video
for this
- read
through
the 'Conditionals
Lab' document)
Once
you're
done
with
this
exercise
the ball
should
bounce
of the
paddle.
When the
ball
first
spawns
(first
appears)
it
should
appear
next to
the
paddle
and
start
moving
upwards.
-
Topic: A
Set of
Sequential
If
Statements
-
VIDEO:
Moving
the
paddle
left
and
right
-
Exercise:
TODO 2:
Sequential
If
Statements
(Hand-In)
-
Topic:
The
Single
If
Exercise:
TODO 3:
Single
If
Statements
Revisited
(Hand-In)
(There
is no
video
for
this)
-
Topic:
Transforming
Sequential
If
Statements
Into A
Single
If-Else
Statement
Exercise:
TODO 99:
Transforming
Sequential
If
Statements
Into A
Single
If-Else
Statement
(Hand-In)
(There
is no
video
for
this)
-
Topic:
Compound
Boolean
Conditions
(using
&& and
||)
-
VIDEO:
Using
logical
operators
-
Exercise:
TODO 4:
Compound
If
Statements
Using
Logical
AND (&&)
(Hand-In)
-
Exercise:
TODO 5:
Compound
If
Statements
Using
Logical
OR (||)
(Hand-In)
-
Topic:
Chained
If/ElseIF
Statements
Without
Default
Else
Exercise:
TODO 6:
Chained
IF/ELSE
Structures
With No
Default
Else
(A.k.a.
Multi-way
Ifs)
(Hand-In)
(There
is no
video
for
this)
-
Topic:
Nested
If
Statements
-
VIDEO:
Nested
if
statements
-
implementing
the
minimum
function
-
Exercise:
TODO 7:
Nested
If
Statements
(Hand-In)
-
Exercise:
TODO 8:
Nested
If-Elses
(A.k.a
If-Elses
Inside
of
If-Elses)
(Hand-In)
-
Topic:
Transforming
Nested
Ifs
using &&
TODO 9:
Transforming
Nested
Ifs
Using &&
(Hand-In)
NOTE:
This
exercise
will ask
you to
rewrite
the code
that you
wrote in
TODO 7,
above.
Make
sure to
save a
copy of
your
work
from
TODO 7
by
copying
that
work
(copy
the
entire
minimum
function),
paste it
into
your
programa,
and
comment
out the
function.
(There
is no
video
for
this)
sdafad
-
Special
Note:
How To
Hand In
Large
Projects
You'll
notice
that the
video-game-based
projects
are huge
- the
downloaded
.zip is
something
like 60
MB, and
once you
build
the
project
it can
easily
grow to
120 MB.
Even
when you
compress
this
it's too
much for
your
browser
to
upload
to
StudentTracker.
The
upload
limit
for
StudentTracker
is
probably
around 1
MB. Here are
instructions
on what
to
remove
in order
to hand
in your
homework.
-
There's
a
video
here
that
will
walk
you
through
all
of
these
steps
-
First,
MAKE
A
COPY
OF
YOUR
WORK.
Copy
the
entire
folder,
even
though
the
folder
may
be
120
MB+.
We're
going
to
delete
a
ton
of
stuff
and
when
we're
done
the
program
will
no
longer
compile.
So
copy
the
folder
containing
your
starter
project
and
all
your
work!
-
Second,
WITHIN
YOUR
COPY
use
the
Windows
Explorer
search
feature
to
find
the
folders
named
"bin"
and
"obj"
and
delete
them.
The
Windows
Explorer
search
feature
is
near
the
top-right
of
the
window
you
get
when
you
ask
Windows
to
show
you
the
computer
(Windows
7:
Start
-->
Computer;
Windows
8:
Start
Screen
->
This
PC).
On
Win8
the
search
box
is
filled
in
with
"Search
This
PC"
(or
"Search
<name
of
directory
that
you're
currently
in")
-
In
the
SpaceSmasher_Game_Project\SpaceSmasher
folder
delete
the
file
named
OBSOLETE.SpaceSmasher.zip.
-
In
the
SpaceSmasher_Game_Project\SpaceSmasher\SpaceSmasherCSharp
folder
delete
the
folders
named
Resources
and
Support
Files.
-
At
the
top
level,
find
the
folder
named
Example_Solution
and
delete
that,
too.
-
At
this
point
you
should
find
that
the
folder
containing
your
work
is
now
about
10
MB,
and
when
you
send
it
to
the
compressed
folder
the
resulting
.ZIP
file
will
be
about
3 MB
in
size.
|