SlideShare une entreprise Scribd logo
1  sur  74
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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장 : 클로저 둘러보기
 

En vedette

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
 

En vedette (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
 

Similaire à [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
 

Similaire à [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
 

Plus de Maja Kraljič

Plus de 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
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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?
 
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
 

[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