Vesa Lappalainen, Lecturer PhD
Antti-Jussi Lakanen, University teacher MSc
Department of Mathematical Information Technology
University of Jyväskylä, Finland
ACM SIGCSE 2011
Dallas, Texas
Room Dallas A1
Vesa Lappalainen
PhD 1985 in Mathematics
Teaching programming since 1982
Research activities:
InSitu
: Interaction possibilities on a mass lecture
ComTest
: Making test-driven development (TDD)
simple
Students’ perceptions of programming
Early recruitment in ICT
My gaming background
Antti-Jussi Lakanen
MSc 2010 in Mathematical
Information Technology
Teaching programming,
recruitment, tutoring freshmen
Research activities
CS1 and games, effect on study success
K-8/K-12 programming
My gaming background
Commodore 64, Amiga 500, ...
Our presentation in a nutshell
We are worried about the
decline in IT, science and math students
We developed a week-long
game programming course for
youngsters to motivate studying
IT, science and math
Jypeli programming library was
developed as a tool to reduce the
cognitive load in beginning game programming
Disclaimer
The course concept
introduced is a
combination of
1.
department staff
(teachers),
2.
tools (Jypeli etc.),
3.
content and
4.
motivated participants
Each of these has its’
own important role in
the process
If we change some part,
Links
https://trac.cc.jyu.fi/projects/npo
https://www.jyu.fi/it/laitokset/mit/opiskelu/nuortenk
urssi
Facebook group:
http://www.facebook.com/#!/group.php?gid=11434543
5260705
Acknowledgements
University of Jyväskylä / Department of Mathematical
Information Technology
Funding courses in 2009, Jypeli development
Technology Industries of Finland Centennial Foundation
Courses in 2010—2011
Agora Center
Research in game development
Microsoft
Software, Xbox controllers
Ville Isomöttönen
Co-author of the paper
Introduction
Student decline in ICT and science
fields (economics still get students)
Amount of students passing the courses
has gone down 50 % since 2004
How to get youngsters to
choose science courses in
high school?
And hopefully to continue
Why this course?
What are the young interested of?
Something to excite!
How to combine fun with “real things”
We wanted to show that concepts of high school math
and science apply also in games
Why not to target senior high?
We wanted to influence what subjects they pick
in
senior high
With senior high students we would be late
Finnish educational system
Elementary school, 6 yrs (
Alakoulu
in Finnish), starts at the age of 7
Junior High School, 3 yrs (
Yläkoulu
in Finnish)
Senior High School
(
lukio
), 3 yrs
Vocational School
(
ammattikoulu
), 3 yrs
University (bachelor),
3 yrs
Polytechnics (bachelor),
3.5 – 4 yrs
University (master), 2 yrs
C
ompul
sor
y
educati
on
50.2 %
41.2 %
(8.6 %)
Pre-school, 1 year (
Esikoulu
in Finnish), starts at the age of 6
Motivation and learning outcomes
1.
Motivation to physics concepts
Quantities: time, distance,
speed, acceleration and force
Causal relationship: dependencies between objects
Gravity, friction, motion, balance
Mass and its effects
Particle kinematics
Motivation and learning outcomes
2.
Motivation to math concepts
Problem solving
Function, interpretation and drawing
Coordinates
Geometry: straight line, scaling, shapes
Vectors
Equations and solving them
Probability and random numbers
Boolean value, logic
How to program games
Two mainstream options
1.
Visual programming
Alice, Scratch, Greenfoot, …
Lego robots (compare to
industrial process programming,
e.g. National Instruments, LabView, etc.)
Microsoft Kodu
2.
Textual programming
Java ACM Task Force
Kodu Game Lab
Jypeli library --
Why and objectives
“Real programming” by mainstream tools
First game should not be many lines of code
“Realistic” physics built-in
Event-driven for controls and collisions
Less structures, as few as zero loops and ifs
Endless possibilities for
advanced programming
Possibility to transfer games
Choosing the tool –
Motivation to building a new library
Lack of Finnish material
Xbox currently only game
console with the possibility to
transfer own games easily
C# as the language
Lack of physics engines in
available libraries out-of-the-box
Limited time available – It also takes time to study a
library someone else has made
Faculty interests in bringing knowledge about
Example game:
Galaxy Trip
using System; using Jypeli; using Jypeli.Effects;
public class Game : PhysicsGame {
static String[] lines = {
" ", " ", " ", " X X ", "X ", " * ", " X X ", " ", " ", " ", " ", "* X X ", "X ", " * ", " X X ", " ", " ", " ", " * ", " X X ", "X ", " ", " X X ", " ", };
static int tileWidth = 800 / lines[0].Length; static int tileHeight = 480 / lines.Length; static Image playerImage =
LoadImage("ship");
static Image galaxyImage = LoadImage("galaxy");
static Image sombreroImage = LoadImage("sombrero"); static Image explosionImage = LoadImage("bum");
ExplosionSystem explosionSystem; PhysicsObject player;
protected override void Begin() {
Level.Background.Image = LoadImage("space"); Gravity = new Vector(0, -1000);
NewGame(null); }
void NewGame(Touch touch) {
ClearGameObjects(); ClearControls();
player = new PhysicsObject(50, 50, Shape.Circle); player.Image = playerImage; Add(player); explosionSystem = new ExplosionSystem(explosionImage, 50); Add(explosionSystem); Keyboard.Listen(Key.Up, ButtonState.Pressed, MovePlayer, "Move up", player, new Vector(0, 500)); Keyboard.Listen(Key.Down, ButtonState.Pressed, MovePlayer, null, player, new Vector(0, -500)); Keyboard.Listen(Key.Left, ButtonState.Pressed, MovePlayer, null, player, new Vector(-500, 0)); Keyboard.Listen(Key.Right, ButtonState.Pressed, MovePlayer, null, player, new Vector(500, 0));
TouchPanel.Listen(ButtonState.Pressed, NewGame, null); Accelerometer.Calibration = AccelerometerCalibration.ZeroAngle; Accelerometer.ListenAnalog(AccelerometerSensitivity.R ealtime, ChangeGravity, null);
TileMap tiles = TileMap.FromStringArray(lines); tiles['X'] = CreateGalaxy; tiles['*'] = CreateSombrero; tiles.Insert(tileWidth, tileHeight); Level.CreateBorders(); Camera.ZoomToLevel(); }
public void MovePlayer(PhysicsObject player, Vector force) { player.Hit(force); } PhysicsObject CreateGalaxy() { PhysicsObject galaxy = PhysicsObject.CreateStaticObject(tileWidth, tileHeight); galaxy.Color = Color.LightBlue; AddCollisionHandler(galaxy, CollidedWithGalaxy); galaxy.Image = galaxyImage; return galaxy; } PhysicsObject CreateSombrero() { PhysicsObject sombrero = PhysicsObject.CreateStaticObject(tileWidth, tileHeight); sombrero.Color = Color.Yellow; sombrero.Image = sombreroImage; AddCollisionHandler(sombrero, CollidedWithSombrero); return sombrero; }
void CollidedWithGalaxy(PhysicsObject galaxy, PhysicsObject target)
{
PlaySound("blop"); }
void CollidedWithSombrero(PhysicsObject sombrero, PhysicsObject target) { PlaySound("exp"); explosionSystem.AddEffect(target.X, target.Y, 50); sombrero.Destroy(); } void ChangeGravity(AnalogState s) { Gravity = s.StateVector * 2000; } }