SlideShare ist ein Scribd-Unternehmen logo
1 von 74
Downloaden Sie, um offline zu lesen
LFU - 12. oktober 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
Koda 
Original: https://github.com/andrea-3000/TAMPON-RUN 
Kopija za delavnico: https://github.com/princessdesign/TAMPON-RUN
Sestavni deli 
● HTML 
● CSS 
● JavaScript 
○ Processing.js http://processingjs.org/ 
○ Buzz Javascript HTML5 Audio knjiznica http://buzz.jaysalvat.com/ 
● Slike, glasba
Avatarji / Slike
Navigacija s tipkami 
● DESNO: 39 // naprej 
● LEVO: 37 // nazaj 
● M: 77 // tiho 
● SHIFT: 16 // start 
● PRESLEDNICA: 32 // tampon 
● GOR: 38 // skok 
● P: 80 // pavza 
● S: 83 // ponovni start
Glasba 
● beethovenSound 
● jumpSound 
● tamponSound 
● gameOverSound 
● ouchSound 
● shootSound
Naredimo svojo igro ...
Igraj igro 5 minut in 
ustvari seznam stvari, 
ki bi jih rada v igri 
spremenila.
TODO 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________
DANES 
● ____________ 
● ____________ 
● ____________ 
● ____________ 
● ____________
Kaj lahko enostavno 
spremenimo? 
● Preskoci intro 
● Tipke za navigacijo 
● Zacetno stevilo tamponov 
● Stevilo tamponov v skatli 
● Barvo tamponov 
● Avatarje 
● Animacije 
● Barvo ozadja 
● Barvo tal 
● Barvo oblakov 
● Sliko svetilke 
● Visino skoka 
● Velikost okna z igro 
● Zacetne slike z uvodom (prevod) 
● Zvoke 
● ...
Datoteke
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 KODA (creators canvas) 
</script> 
<script type="text/processing" data-processing-target="mycanvas"> 
/* JAVASCRIPT 
KODA Z IGRO (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 - Osnove
for loop 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
brackets.io
Komentarji 
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
Stevilke 
for loop 
14 
1+1 
5-2 
32*3 
829/3 
5%4 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Besedilo 
"Ada" 
"Lovelace" 
"Ada".length 
"Lovelace".length 
for loop 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Boolova vrednost 
for loop 
true 
false 
1<2 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Spremenljivka 
for loop 
var score = 0; // stevilka 
score; 
console.log(score); 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
var muted = false; // boolova vrednost 
var feedback = "LFU!!!"; // niz
Tabela for loop 
vrednosti (Array) 
var lampList = []; 
for(var count=0; count<10; count++){ 
var console.tampons log(= ["count); 
red", "green", "blue"]; 
var } 
first = tampons[0]; 
document.write(first); 
console.log(tampons[0]);
Funkcije 
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?");
Funkcije 
for loop 
var sayHello = function(name) { 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
document.write("Hej" + " " + name); 
}; 
sayHello("Maja");
if stavek 
for loop 
var x = 1; 
if ( x === 1) { 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
document.write("x je enak 1"); 
}
if stavek 
for loop 
var x = 4; 
if ( x !== 1) { 
console.log("x ni enak 1"); 
// document.write("x ni enak 1"); 
} 
for(var count=0; count<10; count++){ 
console.log(count); 
}
if for else loop 
stavek 
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 stavek 
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 zanka 
for(var count=0; count<100; count++){ 
document.write(count); 
document.write("<br />") 
}
for zanka 
towns = ["LJ", "MB", "KR", "NM", "KP", "GO", "KR"]; 
for(var i=0; i<towns.length; i++){ 
document.write(towns[i]); 
document.write("<br />") 
}
Objektno programiranje 
Animation 
BuildingFactory 
GameState 
EnemyFactory 
Lamppost 
DuaneReade 
LampFactory 
Building 
Cloud 
Player 
CloudFactory 
Enemy 
Gun 
Tampon 
Ammo
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... 
}
Metode 
for loop 
play(soundToPlay) 
pauseSound(SoundToPlay) 
setup() 
draw() 
keyPressed() 
keyReleased() 
for(var count=0; count<10; count++){ 
console.log(count); 
}
Metode 
for loop 
void pauseSound(soundToPlay) { 
for(var count=0; count<10; count++){ 
console.log(count); 
} 
soundToPlay.pause() 
}
Spremenimo kodo!
Kaj lahko enostavno 
spremenimo? 
● Preskoci intro 
● Tipke za navigacijo 
● Zacetno stevilo tamponov 
● Stevilo tamponov v skatli 
● Barvo tamponov 
● Avatarje 
● Animacije 
● Barvo ozadja 
● Barvo tal 
● Barvo oblakov 
● Sliko svetilke 
● Visino skoka 
● Velikost okna z igro 
● Zacetne slike z uvodom (prevod) 
● Zvoke 
● ...
Preskoci intro 
HINT: Ce si na zacetku (0: home) pritisni SHIFT (tipka 16) in pojdi na igro (3: game 
play) 
if (keyCode == 16 && state.page==0){ 
state.page = 1; // change to 3 
NALOGA: Zakaj zvok ne igra?
Spremeni tipke z ukazi 
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 
NALOGA: Spremeni kodo tako, da bos igrico lahko igrala z eno roko.
Spremeni zacetno st. 
tamponov 
NAMIG: Poisci kje je stevilo definirano in ga spremeni 
//player variables 
var tampon = 10; //50 
NALOGA: Kaj se zgodi, ce igro ponovno zazenes (S)? Popravi! 
NAMIG: End game (4) tipka S (83).
Spremeni stevilo tamponov 
v skatli 
NAMIG: Poisci kje je stevilo definirano in ga spremeni 
tampon = tampon + 5 // 50
Spremni slike v uvodu 
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");
Barva tamponov 
NALOGA: Odpri slike v 
urejevalniku slik in jih 
spremeni. 
● ammo…png 4x 
● attack…png 2x
Ustvari nov avatar (enemy) 
enemies = new EnemyFactory("eWalk", 1); 
/* spremeni v swat in zazeni igro */ 
eWalk swat 
NALOGA: Zdaj ustvari svojega
Animacije 
Animation title; 
title = new Animation("title", 2, 20); 
Animation girlIntro; 
girlIntro = new Animation("walk",2,5);
Barva ozadja 
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); 
*/
Barva tal 
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); 
*/
Barva oblakov 
void showCloud() { 
fill(255); 
fill(0); // black or 
// (0,0,0) (red, green and blue 0-255)
Barva oblakov - siva 
Gray clouds (uncomment c and add c to fill()) 
c = Math.floor((Math.random() * 255) + 1); 
} 
void showCloud() { 
fill(c);
Barva oblakov - nakljucna 
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);
Slika svetilke 
NALOGA: Odpri sliko lamppost0000.png 
v urejevalniku slik in jo spremeni.
Visina skoka 
jumpHeight = 200; 
/* 
jumpHeight = 100; // visje 
jumpHeight = 300; // nizje 
*/
Velikost okna z igro 
var CANVAS_HEIGHT = 500; // 700 
var CANVAS_WIDTH = 700; // 1200
Spremeni zvoke 
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"]});
JAVASCRIPT 
http://learnxinyminutes.com/docs/javascript/ 
http://www.codecademy.com/glossary/javascript 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide 
TUTORIALI 
http://www.codecademy.com/tracks/javascript 
https://www.khanacademy.org/computing/cs
PROCESSINGJS 
http://processingjs.org/reference/
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
Kontakt: 
https://www.facebook.com/princessdesignnet 
https://twitter.com/princessdesign

Weitere ähnliche Inhalte

Was ist angesagt?

An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
Takahiro Inoue
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of Clojure
Mike Fogus
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会
Hiroki Mizuno
 

Was ist angesagt? (20)

Concurrent Application Development using Scala
Concurrent Application Development using ScalaConcurrent Application Development using Scala
Concurrent Application Development using Scala
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
Functional Pe(a)rls - the Purely Functional Datastructures edition
Functional Pe(a)rls - the Purely Functional Datastructures editionFunctional Pe(a)rls - the Purely Functional Datastructures edition
Functional Pe(a)rls - the Purely Functional Datastructures edition
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of Clojure
 
Introduction to Generative Art with Processing
Introduction to Generative Art with ProcessingIntroduction to Generative Art with Processing
Introduction to Generative Art with Processing
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会
 
Functional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipperFunctional pe(a)rls: Huey's zipper
Functional pe(a)rls: Huey's zipper
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
 
ClojurianからみたElixir
ClojurianからみたElixirClojurianからみたElixir
ClojurianからみたElixir
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
FPBrno 2018-05-22: Benchmarking in elixir
FPBrno 2018-05-22: Benchmarking in elixirFPBrno 2018-05-22: Benchmarking in elixir
FPBrno 2018-05-22: Benchmarking in elixir
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new features
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Let's golang
Let's golangLet's golang
Let's golang
 
ProgrammingwithGOLang
ProgrammingwithGOLangProgrammingwithGOLang
ProgrammingwithGOLang
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 

Andere mochten auch

Indirect instruction, com mand, request and invitation
Indirect instruction, com mand, request and invitationIndirect instruction, com mand, request and invitation
Indirect instruction, com mand, request and invitation
Yudhie Indra
 

Andere mochten auch (7)

Resensi buku
Resensi buku Resensi buku
Resensi buku
 
Indirect instruction, com mand, request and invitation
Indirect instruction, com mand, request and invitationIndirect instruction, com mand, request and invitation
Indirect instruction, com mand, request and invitation
 
[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
 
Master Blender Shortcuts
Master Blender ShortcutsMaster Blender Shortcuts
Master Blender Shortcuts
 
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
 
The Right Audience, the Right Time, the Right @#*!?
The Right Audience, the Right Time, the Right @#*!?The Right Audience, the Right Time, the Right @#*!?
The Right Audience, the Right Time, the Right @#*!?
 
Cross-Screen Transplants
Cross-Screen TransplantsCross-Screen Transplants
Cross-Screen Transplants
 

Ähnlich wie [SI] Ada Lovelace Day 2014 - Tampon Run

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
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
Laurence Svekis ✔
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
aztack
 

Ähnlich wie [SI] Ada Lovelace Day 2014 - Tampon Run (20)

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parser
 
Music as data
Music as dataMusic as data
Music as data
 
Groovy
GroovyGroovy
Groovy
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
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
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
 
Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Internal workshop es6_2015
Internal workshop es6_2015Internal workshop es6_2015
Internal workshop es6_2015
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 
Basics
BasicsBasics
Basics
 
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#
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)
 
Raphaël and You
Raphaël and YouRaphaël and You
Raphaël and You
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
Proga 0608
Proga 0608Proga 0608
Proga 0608
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
Scala @ TomTom
Scala @ TomTomScala @ TomTom
Scala @ TomTom
 

Mehr von Maja Kraljič

Mehr von Maja Kraljič (8)

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
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

[SI] Ada Lovelace Day 2014 - Tampon Run

  • 1. LFU - 12. oktober 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. Koda Original: https://github.com/andrea-3000/TAMPON-RUN Kopija za delavnico: https://github.com/princessdesign/TAMPON-RUN
  • 9. Sestavni deli ● HTML ● CSS ● JavaScript ○ Processing.js http://processingjs.org/ ○ Buzz Javascript HTML5 Audio knjiznica http://buzz.jaysalvat.com/ ● Slike, glasba
  • 11. Navigacija s tipkami ● DESNO: 39 // naprej ● LEVO: 37 // nazaj ● M: 77 // tiho ● SHIFT: 16 // start ● PRESLEDNICA: 32 // tampon ● GOR: 38 // skok ● P: 80 // pavza ● S: 83 // ponovni start
  • 12. Glasba ● beethovenSound ● jumpSound ● tamponSound ● gameOverSound ● ouchSound ● shootSound
  • 14. Igraj igro 5 minut in ustvari seznam stvari, ki bi jih rada v igri spremenila.
  • 15. TODO ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________ ● ____________
  • 16. DANES ● ____________ ● ____________ ● ____________ ● ____________ ● ____________
  • 17. Kaj lahko enostavno spremenimo? ● Preskoci intro ● Tipke za navigacijo ● Zacetno stevilo tamponov ● Stevilo tamponov v skatli ● Barvo tamponov ● Avatarje ● Animacije ● Barvo ozadja ● Barvo tal ● Barvo oblakov ● Sliko svetilke ● Visino skoka ● Velikost okna z igro ● Zacetne slike z uvodom (prevod) ● Zvoke ● ...
  • 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 KODA (creators canvas) </script> <script type="text/processing" data-processing-target="mycanvas"> /* JAVASCRIPT KODA Z IGRO (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 - Osnove
  • 24. for loop for(var count=0; count<10; count++){ console.log(count); } brackets.io
  • 25.
  • 26. Komentarji 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. Stevilke for loop 14 1+1 5-2 32*3 829/3 5%4 for(var count=0; count<10; count++){ console.log(count); }
  • 30. Besedilo "Ada" "Lovelace" "Ada".length "Lovelace".length for loop for(var count=0; count<10; count++){ console.log(count); }
  • 31.
  • 32. Boolova vrednost for loop true false 1<2 for(var count=0; count<10; count++){ console.log(count); }
  • 33. Spremenljivka for loop var score = 0; // stevilka score; console.log(score); for(var count=0; count<10; count++){ console.log(count); } var muted = false; // boolova vrednost var feedback = "LFU!!!"; // niz
  • 34. Tabela for loop vrednosti (Array) var lampList = []; for(var count=0; count<10; count++){ var console.tampons log(= ["count); red", "green", "blue"]; var } first = tampons[0]; document.write(first); console.log(tampons[0]);
  • 35.
  • 36. Funkcije 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. Funkcije for loop var sayHello = function(name) { for(var count=0; count<10; count++){ console.log(count); } document.write("Hej" + " " + name); }; sayHello("Maja");
  • 38.
  • 39. if stavek for loop var x = 1; if ( x === 1) { for(var count=0; count<10; count++){ console.log(count); } document.write("x je enak 1"); }
  • 40. if stavek for loop var x = 4; if ( x !== 1) { console.log("x ni enak 1"); // document.write("x ni enak 1"); } for(var count=0; count<10; count++){ console.log(count); }
  • 41.
  • 42. if for else loop stavek 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."); }
  • 43.
  • 44. if for & loop else if & else stavek 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."); }
  • 45.
  • 46. for zanka for(var count=0; count<100; count++){ document.write(count); document.write("<br />") }
  • 47. for zanka towns = ["LJ", "MB", "KR", "NM", "KP", "GO", "KR"]; for(var i=0; i<towns.length; i++){ document.write(towns[i]); document.write("<br />") }
  • 48. Objektno programiranje Animation BuildingFactory GameState EnemyFactory Lamppost DuaneReade LampFactory Building Cloud Player CloudFactory Enemy Gun Tampon Ammo
  • 49. 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... }
  • 50. Metode for loop play(soundToPlay) pauseSound(SoundToPlay) setup() draw() keyPressed() keyReleased() for(var count=0; count<10; count++){ console.log(count); }
  • 51. Metode for loop void pauseSound(soundToPlay) { for(var count=0; count<10; count++){ console.log(count); } soundToPlay.pause() }
  • 53. Kaj lahko enostavno spremenimo? ● Preskoci intro ● Tipke za navigacijo ● Zacetno stevilo tamponov ● Stevilo tamponov v skatli ● Barvo tamponov ● Avatarje ● Animacije ● Barvo ozadja ● Barvo tal ● Barvo oblakov ● Sliko svetilke ● Visino skoka ● Velikost okna z igro ● Zacetne slike z uvodom (prevod) ● Zvoke ● ...
  • 54. Preskoci intro HINT: Ce si na zacetku (0: home) pritisni SHIFT (tipka 16) in pojdi na igro (3: game play) if (keyCode == 16 && state.page==0){ state.page = 1; // change to 3 NALOGA: Zakaj zvok ne igra?
  • 55. Spremeni tipke z ukazi 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 NALOGA: Spremeni kodo tako, da bos igrico lahko igrala z eno roko.
  • 56. Spremeni zacetno st. tamponov NAMIG: Poisci kje je stevilo definirano in ga spremeni //player variables var tampon = 10; //50 NALOGA: Kaj se zgodi, ce igro ponovno zazenes (S)? Popravi! NAMIG: End game (4) tipka S (83).
  • 57. Spremeni stevilo tamponov v skatli NAMIG: Poisci kje je stevilo definirano in ga spremeni tampon = tampon + 5 // 50
  • 58. Spremni slike v uvodu 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");
  • 59. Barva tamponov NALOGA: Odpri slike v urejevalniku slik in jih spremeni. ● ammo…png 4x ● attack…png 2x
  • 60. Ustvari nov avatar (enemy) enemies = new EnemyFactory("eWalk", 1); /* spremeni v swat in zazeni igro */ eWalk swat NALOGA: Zdaj ustvari svojega
  • 61. Animacije Animation title; title = new Animation("title", 2, 20); Animation girlIntro; girlIntro = new Animation("walk",2,5);
  • 62. Barva ozadja 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); */
  • 63. Barva tal 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); */
  • 64. Barva oblakov void showCloud() { fill(255); fill(0); // black or // (0,0,0) (red, green and blue 0-255)
  • 65. Barva oblakov - siva Gray clouds (uncomment c and add c to fill()) c = Math.floor((Math.random() * 255) + 1); } void showCloud() { fill(c);
  • 66. Barva oblakov - nakljucna 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);
  • 67. Slika svetilke NALOGA: Odpri sliko lamppost0000.png v urejevalniku slik in jo spremeni.
  • 68. Visina skoka jumpHeight = 200; /* jumpHeight = 100; // visje jumpHeight = 300; // nizje */
  • 69. Velikost okna z igro var CANVAS_HEIGHT = 500; // 700 var CANVAS_WIDTH = 700; // 1200
  • 70. Spremeni zvoke 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"]});
  • 71. JAVASCRIPT http://learnxinyminutes.com/docs/javascript/ http://www.codecademy.com/glossary/javascript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide TUTORIALI http://www.codecademy.com/tracks/javascript https://www.khanacademy.org/computing/cs
  • 73. 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