SlideShare ist ein Scribd-Unternehmen logo
1 von 75
Downloaden Sie, um offline zu lesen
LFU - 12. October 2014 - Ljubljana - KCQ
Ada 
Lovelace 
L. F. Menabrea: Sketch of The Analytical Engine Invented 
by Charles Babbage Note G
Have the courage 
to try. You can 
make amazing 
things happen. 
Megan Smith, U.S. CTO, former VP of Google[x] 
Photo: Taylor Hill/FilmMagic for
Source Code 
Original: https://github.com/andrea-3000/TAMPON-RUN 
Workshop Copy: https://github.com/princessdesign/TAMPON-RUN
Building Blocks 
● HTML 
● CSS 
● JavaScript 
○ Processing.js http://processingjs.org/ 
○ Buzz a Javascript HTML5 Audio library http://buzz.jaysalvat.com/ 
● Images, music
Avatars / Images
Navigation with Keys 
● RIGHT: 39 // forward 
● LEFT: 37 // back 
● M: 77 // mute 
● SHIFT: 16 // begin 
● SPACE: 32 // throw tampon 
● UP: 38 // jump 
● P: 80 // pause 
● S: 83 // restart
Music 
● beethovenSound 
● jumpSound 
● tamponSound 
● gameOverSound 
● ouchSound 
● shootSound
Let’s make our own game...
Play the game for the next 
5 minutes and make a list 
of things you would like 
to change.
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
TODO
DOABLE TODAY 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________
What can we ‘easily’ 
change? 
● Skip intro and go directly to the game 
● Navigation keys 
● Initial number of tampons 
● Number of tampons in the pack 
● Color of tampons 
● Avatar of the enemy 
● Animations 
● Background color 
● Ground color 
● Cloud color 
● Image of the lamppost 
● Change lamppost into another object 
● The height of the jump 
● Larger canvas with the game 
● Change Intro Images (Translate) 
● Change sounds 
● ...
Let’s do it...
index.html
<html> 
<head> 
<title>Tampon Run!</title> 
<style type="text/css"> 
/* CSS CODE for STYLE */ 
</style> 
<script src="lib/processing-1.4.1.min.js"></script> 
<script src="lib/buzz.min.js" type="text/javascript"></script> 
<script type="text/processing" data-processing-target="creators"> 
// JAVASCRIPT CODE (creators canvas) 
</script> 
<script type="text/processing" data-processing-target="mycanvas"> 
/* JAVASCRIPT 
CODE FOR THE GAME (mycanvas canvas) */ 
</script> 
</head> 
<body> 
<canvas id="creators"></canvas> 
<canvas id="mycanvas"></canvas> 
</body> 
</html>
for loop 
for(var count=0; count<10; count++){ 
console.log(count); 
}JavaScript Basics
brackets.io
Comments 
for loop 
// Hi, my name is comment 
for(var count=0; count<10; count++){ 
console.log(count); 
/* 
} 
I am comment too. 
I can take more space. 
*/
for test.html 
loop 
<html> 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
<head> 
<script> 
console.log("JavaScript"); 
</script> 
</head> 
<body> 
</body> 
</html>
Google Chrome Console
Numbers 
for loop 
14 
1+1 
5-2 
32*3 
829/3 
5%4 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Strings 
"Ada" 
"Lovelace" 
"Ada".length 
"Lovelace".length 
for loop 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Boolean 
for loop 
true 
false 
1<2 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Variables 
for loop 
var score = 0; // number 
score; 
console.log(score); 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
var muted = false; // boolean 
var feedback = "I feel awesome";
Arrays 
for loop 
var lampList = []; 
for(var count=0; count<10; count++){ 
var console.tampons log(= ["count); 
red", "green", "blue"]; 
var } 
first = tampons[0]; 
console.log(first); 
console.log(tampons[0]);
Functions 
for loop 
confirm("I feel awesome!"); 
for(var count=0; count<10; count++){ 
console.log(count); 
prompt("What is your name?"); 
} 
console.log("What is your name?");
Functions 
for loop 
var sayHello = function(name) { 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
console.log("Hello" + " " + name); 
}; 
sayHello("Maja");
Functions / Methods 
for loop 
void pauseSound(soundToPlay) { 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
soundToPlay.pause() 
}
if sentence 
for loop 
var x = 1; 
if ( x == 1) { 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
console.log("x equals 1"); 
}
if sentence 
for loop 
var x = 4; 
if ( x !== 1) { 
console.log("x doesn’t equal 1"); 
} 
for(var count=0; count<10; count++){ 
console.log(count); 
}
if for else 
loop 
var key = "left"; 
for(var count=0; count<10; count++){ 
if (key == "up" ){ 
console.log(count); 
} 
console.log("Key is up."); 
} else { 
console.log("Some key."); 
}
if for & loop 
else if & else 
var key = "left"; 
for(var count=0; count<10; count++){ 
if (key == "right" ) { 
console.log(count); 
} 
console.log("Key is right."); 
} else if (key == "up" ){ 
console.log("Key is up."); 
} else { 
console.log("Some key."); 
}
for loop 
for(var count=0; count<100; count++){ 
console.log(count); 
}
for loop 
towns = ["LJ", "MB", "KR", "NM", "KP", "GO", "KR"]; 
for(var i=0; i<towns.length; i++){ 
document.write(towns[i]); 
document.write("<br />") 
}
Classes and objects 
Animation 
GameState 
Lamppost 
LampFactory 
Cloud 
CloudFactory 
Gun 
Ammo 
BuildingFactory 
EnemyFactory 
DuaneReade 
Building 
Player 
Enemy 
Tampon
class Tampon { 
var xTamp; 
var yTamp; 
var tampSpeed; 
var randFR; 
Animation tampPic; 
var h; 
var w; 
Tampon() { 
xTamp = 750; 
yTamp = 250; 
tampSpeed = -2; 
randFR = Math.floor((Math.random() * 20) + 8); 
tampPic = new Animation("tampz", 2, randFR); 
h = tampPic.getHeight(); 
w = tampPic.getWidth(); 
} 
void showTamp() { 
tampPic.display(xTamp, yTamp); 
} 
void moveTamp() { 
xTamp = xTamp + tampSpeed; 
} 
void releaseTamp() { 
yTamp = yTamp + tampSpeed; 
} 
} 
class DuaneReade { 
var tamponList; 
DuaneReade() { 
tamponList = []; 
} 
void animate() { 
var willItBlend = Math.floor((Math.random() * 500) + 1); 
if (willItBlend == 50) { 
tamponList.push(new Tampon()); 
} 
showTamponList(); 
moveTamponList(); 
removeTampon(); 
reloadTampon(); 
} 
// MORE CODE... 
}
Methods 
play(soundToPlay) 
pauseSound(SoundToPlay) 
setup() 
draw() 
keyPressed() 
keyReleased()
Remember what you wanted 
to change in the game?
What can we ‘easily’ 
change? 
● Skip intro and go directly to the game 
● Navigation keys 
● Initial number of tampons 
● Number of tampons in the pack 
● Color of tampons 
● Avatar of the enemy 
● Animations 
● Background color 
● Ground color 
● Cloud color 
● Image of the lamppost 
● Change lamppost into another object 
● The height of the jump 
● Larger canvas with the game 
● Change Intro Images (Translate) 
● Change sounds 
● ...
Skip intro 
HINT: If you are on the first page (0: home) press SHIFT (key 16) and go to the game 
page (3: game play) 
if (keyCode == 16 && state.page==0){ 
state.page = 1; // change to 3 
Why is sound not playing?
Change navigation keys 
if (keyCode == 77) 
if (keyCode == 39) 
if (keyCode == 16) 
if (keyCode == 83) 
if (keyCode == 38) 
SPACE: 32 // throw tampon 
RIGHT: 39 // forward 
LEFT: 37 // back 
M: 77 // mute 
SHIFT: 16 // begin 
UP: 38 // jump 
P: 80 // pause 
S: 83 // restart 
TASK: Change the code so that you will be able to play the game with one hand!
Change the number of 
initial tampons 
HINT: find where the number is defined and change it 
//player variables 
var tampon = 10; //50 
TASK: What happens if we restart the game (S)? Fix it! 
HINT: Find where the conditions are end screen (4) and key S (83).
Change the number of 
tampons in the pack 
HINT: Find where the number is defined and change it 
tampon = tampon + 5 // 50
Change intro images 
statementOne = loadImage("res/statementOne0000.png"); 
statementTwo = loadImage("res/statementTwo0000.png"); 
statementThree = loadImage("res/statementThree0000.png"); 
statementFour = loadImage("res/statementFour0000.png"); 
statementFive = loadImage("res/statementFive0000.png"); 
instructOne = loadImage("res/learn0000.png"); 
pausePage = loadImage("res/pause0000.png");
Color of tampons 
TASK: Open images in image 
editor and change the color. 
● ammo…png 4x 
● attack…png 2x
New enemy 
enemies = new EnemyFactory("eWalk", 1); 
/* change to swat and play the game */ 
eWalk swat 
TASK: Now try to build your own.
Animations 
Animation title; 
title = new Animation("title", 2, 20); 
Animation girlIntro; 
girlIntro = new Animation("walk",2,5);
Background coloor 
void startGame() { 
background(100); 
/* 
background(255,255,0); //yellow (red, green and blue 0-255) 
color yellow = color(255,252, 25); 
color red = color(178,18,18); 
color orange = color(255,83, 13); 
color blue = color(9, 113, 178); 
color pink = color(255, 182, 193); 
*/
Ground color 
void showBuilding() { 
fill(0); // color name or number(s) 
/* 
background(255,255,0); //yellow (red, green and blue 0-255) 
color yellow = color(255,252, 25); 
color red = color(178,18,18); 
color orange = color(255,83, 13); 
color blue = color(9, 113, 178); 
color pink = color(255, 182, 193); 
*/
Change the cloud color 
void showCloud() { 
fill(255); 
fill(0); // black or 
// (0,0,0) (red, green and blue 0-255)
Change the cloud color 
Gray clouds (uncomment c and add c to fill()) 
c = Math.floor((Math.random() * 255) + 1); 
} 
void showCloud() { 
fill(c);
Change the cloud color 
Color clouds 
r = Math.floor((Math.random() * 255) + 1); 
g = Math.floor((Math.random() * 255) + 1); 
b = Math.floor((Math.random() * 255) + 1); 
} 
void showCloud() { 
fill(r,g,b);
Image of lamppost 
TASK: Open the image 
lamppost0000.png in Image editor 
and change it.
Height of the jump 
jumpHeight = 200; 
/* 
jumpHeight = 100; // higher 
jumpHeight = 300; // lower 
*/
Larger game canvas 
var CANVAS_HEIGHT = 500; // 700 
var CANVAS_WIDTH = 700; // 1200
Change sounds 
var jumpSound = new buzz.sound("res/sound/jumpSound", {formats: ["ogg", "mp3"]}); 
var tamponSound = new buzz.sound("res/sound/tamponSound", {formats: ["ogg", "mp3"]}); 
var gameOverSound = new buzz.sound("res/sound/gameOverSound", {formats: ["ogg", "mp3"]}); 
var beethovenSound = new buzz.sound("res/sound/beethovenSound", {formats: ["ogg", "mp3"]}); 
var ouchSound = new buzz.sound("res/sound/ouchSound", {formats: ["ogg", "mp3"]}); 
var shootSound = new buzz.sound("res/sound/shootSound", {formats: ["ogg", "mp3"]});
You can leave behind the old 
regressive sexist 
representations and 
instead create interactive 
experiences that portray 
women as capable, complex 
and inspirational. 
Anita Sarkeesian, Feminist Frequency
JAVASCRIPT REFERENCE 
http://learnxinyminutes.com/docs/javascript/ 
http://www.codecademy.com/glossary/javascript 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide 
TUTORIALS 
http://www.codecademy.com/tracks/javascript 
https://www.khanacademy.org/computing/cs
PROCESSINGJS REFERENCE 
http://processingjs.org/reference/
Contact: 
https://www.facebook.com/princessdesignnet 
https://twitter.com/princessdesign

Weitere ähnliche Inhalte

Was ist angesagt?

The Ring programming language version 1.3 book - Part 36 of 88
The Ring programming language version 1.3 book - Part 36 of 88The Ring programming language version 1.3 book - Part 36 of 88
The Ring programming language version 1.3 book - Part 36 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184Mahmoud Samir Fayed
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitTobias Pfeiffer
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitTobias Pfeiffer
 
Gdc09 Minipong
Gdc09 MinipongGdc09 Minipong
Gdc09 MinipongSusan Gold
 
How fast ist it really? Benchmarking in practice
How fast ist it really? Benchmarking in practiceHow fast ist it really? Benchmarking in practice
How fast ist it really? Benchmarking in practiceTobias Pfeiffer
 
Communities - Perl edition (RioJS)
Communities - Perl edition (RioJS)Communities - Perl edition (RioJS)
Communities - Perl edition (RioJS)garux
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveEleanor McHugh
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swiftChiwon Song
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new featuresGephenSG
 
Go Containers
Go ContainersGo Containers
Go Containersjgrahamc
 
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)Shift Conference
 
Concurrent Application Development using Scala
Concurrent Application Development using ScalaConcurrent Application Development using Scala
Concurrent Application Development using ScalaSiarhiej Siemianchuk
 
The Ring programming language version 1.5.4 book - Part 47 of 185
The Ring programming language version 1.5.4 book - Part 47 of 185The Ring programming language version 1.5.4 book - Part 47 of 185
The Ring programming language version 1.5.4 book - Part 47 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210Mahmoud Samir Fayed
 
Javascript - The basics
Javascript - The basicsJavascript - The basics
Javascript - The basicsBruno Paulino
 
Snickers: Open Source HTTP API for Media Encoding
Snickers: Open Source HTTP API for Media EncodingSnickers: Open Source HTTP API for Media Encoding
Snickers: Open Source HTTP API for Media EncodingFlávio Ribeiro
 
Elixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII SorocabaElixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII SorocabaFabio Akita
 

Was ist angesagt? (20)

The Ring programming language version 1.3 book - Part 36 of 88
The Ring programming language version 1.3 book - Part 36 of 88The Ring programming language version 1.3 book - Part 36 of 88
The Ring programming language version 1.3 book - Part 36 of 88
 
The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184The Ring programming language version 1.5.3 book - Part 46 of 184
The Ring programming language version 1.5.3 book - Part 46 of 184
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicit
 
Elixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicitElixir & Phoenix – fast, concurrent and explicit
Elixir & Phoenix – fast, concurrent and explicit
 
Gdc09 Minipong
Gdc09 MinipongGdc09 Minipong
Gdc09 Minipong
 
dplyr
dplyrdplyr
dplyr
 
How fast ist it really? Benchmarking in practice
How fast ist it really? Benchmarking in practiceHow fast ist it really? Benchmarking in practice
How fast ist it really? Benchmarking in practice
 
Communities - Perl edition (RioJS)
Communities - Perl edition (RioJS)Communities - Perl edition (RioJS)
Communities - Perl edition (RioJS)
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swift
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new features
 
Go Containers
Go ContainersGo Containers
Go Containers
 
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
 
Concurrent Application Development using Scala
Concurrent Application Development using ScalaConcurrent Application Development using Scala
Concurrent Application Development using Scala
 
The Ring programming language version 1.5.4 book - Part 47 of 185
The Ring programming language version 1.5.4 book - Part 47 of 185The Ring programming language version 1.5.4 book - Part 47 of 185
The Ring programming language version 1.5.4 book - Part 47 of 185
 
The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210The Ring programming language version 1.9 book - Part 56 of 210
The Ring programming language version 1.9 book - Part 56 of 210
 
New
NewNew
New
 
Javascript - The basics
Javascript - The basicsJavascript - The basics
Javascript - The basics
 
Snickers: Open Source HTTP API for Media Encoding
Snickers: Open Source HTTP API for Media EncodingSnickers: Open Source HTTP API for Media Encoding
Snickers: Open Source HTTP API for Media Encoding
 
Elixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII SorocabaElixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
Elixir - Tolerância a Falhas para Adultos - Secot VIII Sorocaba
 

Ähnlich wie [EN] Ada Lovelace Day 2014 - Tampon run

SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parserkamaelian
 
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212Mahmoud Samir Fayed
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to CodingFabio506452
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6FITC
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Paulo Morgado
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick touraztack
 
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupДоклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupBadoo Development
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and GoEleanor McHugh
 

Ähnlich wie [EN] Ada Lovelace Day 2014 - Tampon run (20)

Music as data
Music as dataMusic as data
Music as data
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parser
 
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Basics
BasicsBasics
Basics
 
Pygame presentation
Pygame presentationPygame presentation
Pygame presentation
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
 
Groovy
GroovyGroovy
Groovy
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#
 
Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupДоклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Java script
Java scriptJava script
Java script
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 
Sbaw090623
Sbaw090623Sbaw090623
Sbaw090623
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 

Mehr von Maja Kraljič

MozFest London 2019 - Feminist internet and feminist principles of the internet
MozFest London 2019  - Feminist internet and feminist principles of the internetMozFest London 2019  - Feminist internet and feminist principles of the internet
MozFest London 2019 - Feminist internet and feminist principles of the internetMaja Kraljič
 
Safer Online Communication
Safer Online CommunicationSafer Online Communication
Safer Online CommunicationMaja Kraljič
 
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018Maja Kraljič
 
Tech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist UniversityTech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist UniversityMaja Kraljič
 
Ubuntu 18.04 Bionic Beaver Installation Party
Ubuntu 18.04 Bionic Beaver Installation PartyUbuntu 18.04 Bionic Beaver Installation Party
Ubuntu 18.04 Bionic Beaver Installation PartyMaja Kraljič
 
Prižiganje lučk z Arduinom
Prižiganje lučk z ArduinomPrižiganje lučk z Arduinom
Prižiganje lučk z ArduinomMaja Kraljič
 
Ada Lovelace Day 2017
Ada Lovelace Day 2017Ada Lovelace Day 2017
Ada Lovelace Day 2017Maja Kraljič
 
Get to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuGet to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuMaja Kraljič
 
Ada Lovelace Day 2015 - Privacy in the Age of Surveillance
Ada Lovelace Day 2015 - Privacy in the Age of SurveillanceAda Lovelace Day 2015 - Privacy in the Age of Surveillance
Ada Lovelace Day 2015 - Privacy in the Age of SurveillanceMaja Kraljič
 
Master Blender Shortcuts
Master Blender ShortcutsMaster Blender Shortcuts
Master Blender ShortcutsMaja Kraljič
 
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnoveMaja Kraljič
 

Mehr von Maja Kraljič (11)

MozFest London 2019 - Feminist internet and feminist principles of the internet
MozFest London 2019  - Feminist internet and feminist principles of the internetMozFest London 2019  - Feminist internet and feminist principles of the internet
MozFest London 2019 - Feminist internet and feminist principles of the internet
 
Safer Online Communication
Safer Online CommunicationSafer Online Communication
Safer Online Communication
 
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
 
Tech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist UniversityTech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist University
 
Ubuntu 18.04 Bionic Beaver Installation Party
Ubuntu 18.04 Bionic Beaver Installation PartyUbuntu 18.04 Bionic Beaver Installation Party
Ubuntu 18.04 Bionic Beaver Installation Party
 
Prižiganje lučk z Arduinom
Prižiganje lučk z ArduinomPrižiganje lučk z Arduinom
Prižiganje lučk z Arduinom
 
Ada Lovelace Day 2017
Ada Lovelace Day 2017Ada Lovelace Day 2017
Ada Lovelace Day 2017
 
Get to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuGet to know linux - First steps with Ubuntu
Get to know linux - First steps with Ubuntu
 
Ada Lovelace Day 2015 - Privacy in the Age of Surveillance
Ada Lovelace Day 2015 - Privacy in the Age of SurveillanceAda Lovelace Day 2015 - Privacy in the Age of Surveillance
Ada Lovelace Day 2015 - Privacy in the Age of Surveillance
 
Master Blender Shortcuts
Master Blender ShortcutsMaster Blender Shortcuts
Master Blender Shortcuts
 
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
 

Kürzlich hochgeladen

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Kürzlich hochgeladen (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

[EN] Ada Lovelace Day 2014 - Tampon run

  • 1. LFU - 12. October 2014 - Ljubljana - KCQ
  • 2. Ada Lovelace L. F. Menabrea: Sketch of The Analytical Engine Invented by Charles Babbage Note G
  • 3.
  • 4. Have the courage to try. You can make amazing things happen. Megan Smith, U.S. CTO, former VP of Google[x] Photo: Taylor Hill/FilmMagic for
  • 5.
  • 6.
  • 7.
  • 8. Source Code Original: https://github.com/andrea-3000/TAMPON-RUN Workshop Copy: https://github.com/princessdesign/TAMPON-RUN
  • 9. Building Blocks ● HTML ● CSS ● JavaScript ○ Processing.js http://processingjs.org/ ○ Buzz a Javascript HTML5 Audio library http://buzz.jaysalvat.com/ ● Images, music
  • 11. Navigation with Keys ● RIGHT: 39 // forward ● LEFT: 37 // back ● M: 77 // mute ● SHIFT: 16 // begin ● SPACE: 32 // throw tampon ● UP: 38 // jump ● P: 80 // pause ● S: 83 // restart
  • 12. Music ● beethovenSound ● jumpSound ● tamponSound ● gameOverSound ● ouchSound ● shootSound
  • 13. Let’s make our own game...
  • 14. Play the game for the next 5 minutes and make a list of things you would like to change.
  • 15. ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ TODO
  • 16. DOABLE TODAY ● ____________ ● ____________ ● ____________ ● ____________ ● ____________
  • 17. What can we ‘easily’ change? ● Skip intro and go directly to the game ● Navigation keys ● Initial number of tampons ● Number of tampons in the pack ● Color of tampons ● Avatar of the enemy ● Animations ● Background color ● Ground color ● Cloud color ● Image of the lamppost ● Change lamppost into another object ● The height of the jump ● Larger canvas with the game ● Change Intro Images (Translate) ● Change sounds ● ...
  • 19.
  • 20.
  • 22. <html> <head> <title>Tampon Run!</title> <style type="text/css"> /* CSS CODE for STYLE */ </style> <script src="lib/processing-1.4.1.min.js"></script> <script src="lib/buzz.min.js" type="text/javascript"></script> <script type="text/processing" data-processing-target="creators"> // JAVASCRIPT CODE (creators canvas) </script> <script type="text/processing" data-processing-target="mycanvas"> /* JAVASCRIPT CODE FOR THE GAME (mycanvas canvas) */ </script> </head> <body> <canvas id="creators"></canvas> <canvas id="mycanvas"></canvas> </body> </html>
  • 23. for loop for(var count=0; count<10; count++){ console.log(count); }JavaScript Basics
  • 25.
  • 26. Comments for loop // Hi, my name is comment for(var count=0; count<10; count++){ console.log(count); /* } I am comment too. I can take more space. */
  • 27. for test.html loop <html> for(var count=0; count<10; count++){ console.log(count); } <head> <script> console.log("JavaScript"); </script> </head> <body> </body> </html>
  • 29. Numbers for loop 14 1+1 5-2 32*3 829/3 5%4 for(var count=0; count<10; count++){ console.log(count); }
  • 30. Strings "Ada" "Lovelace" "Ada".length "Lovelace".length for loop for(var count=0; count<10; count++){ console.log(count); }
  • 31.
  • 32. Boolean for loop true false 1<2 for(var count=0; count<10; count++){ console.log(count); }
  • 33. Variables for loop var score = 0; // number score; console.log(score); for(var count=0; count<10; count++){ console.log(count); } var muted = false; // boolean var feedback = "I feel awesome";
  • 34. Arrays for loop var lampList = []; for(var count=0; count<10; count++){ var console.tampons log(= ["count); red", "green", "blue"]; var } first = tampons[0]; console.log(first); console.log(tampons[0]);
  • 35.
  • 36. Functions for loop confirm("I feel awesome!"); for(var count=0; count<10; count++){ console.log(count); prompt("What is your name?"); } console.log("What is your name?");
  • 37. Functions for loop var sayHello = function(name) { for(var count=0; count<10; count++){ console.log(count); } console.log("Hello" + " " + name); }; sayHello("Maja");
  • 38. Functions / Methods for loop void pauseSound(soundToPlay) { for(var count=0; count<10; count++){ console.log(count); } soundToPlay.pause() }
  • 39.
  • 40. if sentence for loop var x = 1; if ( x == 1) { for(var count=0; count<10; count++){ console.log(count); } console.log("x equals 1"); }
  • 41.
  • 42. if sentence for loop var x = 4; if ( x !== 1) { console.log("x doesn’t equal 1"); } for(var count=0; count<10; count++){ console.log(count); }
  • 43. if for else loop var key = "left"; for(var count=0; count<10; count++){ if (key == "up" ){ console.log(count); } console.log("Key is up."); } else { console.log("Some key."); }
  • 44.
  • 45.
  • 46. if for & loop else if & else var key = "left"; for(var count=0; count<10; count++){ if (key == "right" ) { console.log(count); } console.log("Key is right."); } else if (key == "up" ){ console.log("Key is up."); } else { console.log("Some key."); }
  • 47.
  • 48. for loop for(var count=0; count<100; count++){ console.log(count); }
  • 49. for loop towns = ["LJ", "MB", "KR", "NM", "KP", "GO", "KR"]; for(var i=0; i<towns.length; i++){ document.write(towns[i]); document.write("<br />") }
  • 50. Classes and objects Animation GameState Lamppost LampFactory Cloud CloudFactory Gun Ammo BuildingFactory EnemyFactory DuaneReade Building Player Enemy Tampon
  • 51. class Tampon { var xTamp; var yTamp; var tampSpeed; var randFR; Animation tampPic; var h; var w; Tampon() { xTamp = 750; yTamp = 250; tampSpeed = -2; randFR = Math.floor((Math.random() * 20) + 8); tampPic = new Animation("tampz", 2, randFR); h = tampPic.getHeight(); w = tampPic.getWidth(); } void showTamp() { tampPic.display(xTamp, yTamp); } void moveTamp() { xTamp = xTamp + tampSpeed; } void releaseTamp() { yTamp = yTamp + tampSpeed; } } class DuaneReade { var tamponList; DuaneReade() { tamponList = []; } void animate() { var willItBlend = Math.floor((Math.random() * 500) + 1); if (willItBlend == 50) { tamponList.push(new Tampon()); } showTamponList(); moveTamponList(); removeTampon(); reloadTampon(); } // MORE CODE... }
  • 52. Methods play(soundToPlay) pauseSound(SoundToPlay) setup() draw() keyPressed() keyReleased()
  • 53. Remember what you wanted to change in the game?
  • 54. What can we ‘easily’ change? ● Skip intro and go directly to the game ● Navigation keys ● Initial number of tampons ● Number of tampons in the pack ● Color of tampons ● Avatar of the enemy ● Animations ● Background color ● Ground color ● Cloud color ● Image of the lamppost ● Change lamppost into another object ● The height of the jump ● Larger canvas with the game ● Change Intro Images (Translate) ● Change sounds ● ...
  • 55. Skip intro HINT: If you are on the first page (0: home) press SHIFT (key 16) and go to the game page (3: game play) if (keyCode == 16 && state.page==0){ state.page = 1; // change to 3 Why is sound not playing?
  • 56. Change navigation keys if (keyCode == 77) if (keyCode == 39) if (keyCode == 16) if (keyCode == 83) if (keyCode == 38) SPACE: 32 // throw tampon RIGHT: 39 // forward LEFT: 37 // back M: 77 // mute SHIFT: 16 // begin UP: 38 // jump P: 80 // pause S: 83 // restart TASK: Change the code so that you will be able to play the game with one hand!
  • 57. Change the number of initial tampons HINT: find where the number is defined and change it //player variables var tampon = 10; //50 TASK: What happens if we restart the game (S)? Fix it! HINT: Find where the conditions are end screen (4) and key S (83).
  • 58. Change the number of tampons in the pack HINT: Find where the number is defined and change it tampon = tampon + 5 // 50
  • 59. Change intro images statementOne = loadImage("res/statementOne0000.png"); statementTwo = loadImage("res/statementTwo0000.png"); statementThree = loadImage("res/statementThree0000.png"); statementFour = loadImage("res/statementFour0000.png"); statementFive = loadImage("res/statementFive0000.png"); instructOne = loadImage("res/learn0000.png"); pausePage = loadImage("res/pause0000.png");
  • 60. Color of tampons TASK: Open images in image editor and change the color. ● ammo…png 4x ● attack…png 2x
  • 61. New enemy enemies = new EnemyFactory("eWalk", 1); /* change to swat and play the game */ eWalk swat TASK: Now try to build your own.
  • 62. Animations Animation title; title = new Animation("title", 2, 20); Animation girlIntro; girlIntro = new Animation("walk",2,5);
  • 63. Background coloor void startGame() { background(100); /* background(255,255,0); //yellow (red, green and blue 0-255) color yellow = color(255,252, 25); color red = color(178,18,18); color orange = color(255,83, 13); color blue = color(9, 113, 178); color pink = color(255, 182, 193); */
  • 64. Ground color void showBuilding() { fill(0); // color name or number(s) /* background(255,255,0); //yellow (red, green and blue 0-255) color yellow = color(255,252, 25); color red = color(178,18,18); color orange = color(255,83, 13); color blue = color(9, 113, 178); color pink = color(255, 182, 193); */
  • 65. Change the cloud color void showCloud() { fill(255); fill(0); // black or // (0,0,0) (red, green and blue 0-255)
  • 66. Change the cloud color Gray clouds (uncomment c and add c to fill()) c = Math.floor((Math.random() * 255) + 1); } void showCloud() { fill(c);
  • 67. Change the cloud color Color clouds r = Math.floor((Math.random() * 255) + 1); g = Math.floor((Math.random() * 255) + 1); b = Math.floor((Math.random() * 255) + 1); } void showCloud() { fill(r,g,b);
  • 68. Image of lamppost TASK: Open the image lamppost0000.png in Image editor and change it.
  • 69. Height of the jump jumpHeight = 200; /* jumpHeight = 100; // higher jumpHeight = 300; // lower */
  • 70. Larger game canvas var CANVAS_HEIGHT = 500; // 700 var CANVAS_WIDTH = 700; // 1200
  • 71. Change sounds var jumpSound = new buzz.sound("res/sound/jumpSound", {formats: ["ogg", "mp3"]}); var tamponSound = new buzz.sound("res/sound/tamponSound", {formats: ["ogg", "mp3"]}); var gameOverSound = new buzz.sound("res/sound/gameOverSound", {formats: ["ogg", "mp3"]}); var beethovenSound = new buzz.sound("res/sound/beethovenSound", {formats: ["ogg", "mp3"]}); var ouchSound = new buzz.sound("res/sound/ouchSound", {formats: ["ogg", "mp3"]}); var shootSound = new buzz.sound("res/sound/shootSound", {formats: ["ogg", "mp3"]});
  • 72. You can leave behind the old regressive sexist representations and instead create interactive experiences that portray women as capable, complex and inspirational. Anita Sarkeesian, Feminist Frequency
  • 73. JAVASCRIPT REFERENCE http://learnxinyminutes.com/docs/javascript/ http://www.codecademy.com/glossary/javascript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide TUTORIALS http://www.codecademy.com/tracks/javascript https://www.khanacademy.org/computing/cs