SlideShare a Scribd company logo
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

More Related Content

What's hot

Concurrent Application Development using Scala
Concurrent Application Development using ScalaConcurrent Application Development using Scala
Concurrent Application Development using Scala
Siarhiej Siemianchuk
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to TinkerpopTakahiro Inoue
 
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
osfameron
 
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
akaptur
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureMike Fogus
 
Introduction to Generative Art with Processing
Introduction to Generative Art with ProcessingIntroduction to Generative Art with Processing
Introduction to Generative Art with Processing
stefk00
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会Hiroki Mizuno
 
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
osfameron
 
Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?Is Haskell an acceptable Perl?
Is Haskell an acceptable Perl?
osfameron
 
ClojurianからみたElixir
ClojurianからみたElixirClojurianからみたElixir
ClojurianからみたElixir
Kent Ohashi
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
Adam Dudczak
 
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
Functional Programming Brno
 
ECMAScript 6 new features
ECMAScript 6 new featuresECMAScript 6 new features
ECMAScript 6 new features
GephenSG
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
Simon Proctor
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
Simon Proctor
 
Let's golang
Let's golangLet's golang
Let's golang
SuHyun Jeon
 
Go Containers
Go ContainersGo Containers
Go Containers
jgrahamc
 
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
Chetan Giridhar
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
JangHyuk You
 

What's hot (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장 : 클로저 둘러보기
 

Viewers also liked

Resensi buku
Resensi buku Resensi buku
Resensi buku
Winda Tampz
 
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 invitationYudhie Indra
 
[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
Maja Kraljič
 
Master Blender Shortcuts
Master Blender ShortcutsMaster Blender Shortcuts
Master Blender Shortcuts
Maja 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 Surveillance
Maja Kraljič
 
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 @#*!?
Celtra Inc
 
Cross-Screen Transplants
Cross-Screen TransplantsCross-Screen Transplants
Cross-Screen Transplants
Celtra Inc
 

Viewers also liked (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
 

Similar to [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 ClojureDmitry Buzdin
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parser
kamaelian
 
Music as data
Music as dataMusic as data
Music as data
John Vlachoyiannis
 
Groovy
GroovyGroovy
Groovy
Zen Urban
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
André Faria Gomes
 
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 ✔
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
FITC
 
Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011
Scalac
 
Internal workshop es6_2015
Internal workshop es6_2015Internal workshop es6_2015
Internal workshop es6_2015
Miguel Ruiz Rodriguez
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
James Ford
 
Basics
BasicsBasics
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
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
DevGAMM Conference
 
Programming ppt files (final)
Programming ppt files (final)Programming ppt files (final)
Programming ppt files (final)
yap_raiza
 
Raphaël and You
Raphaël and YouRaphaël and You
Raphaël and You
Trotter Cashion
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick touraztack
 
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
Eleanor McHugh
 
Scala @ TomTom
Scala @ TomTomScala @ TomTom
Scala @ TomTom
Eric Bowman
 

Similar to [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
 

More from 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 internet
Maja Kraljič
 
Safer Online Communication
Safer Online CommunicationSafer Online Communication
Safer Online Communication
Maja 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 2018
Maja Kraljič
 
Tech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist UniversityTech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist University
Maja 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 Party
Maja Kraljič
 
Prižiganje lučk z Arduinom
Prižiganje lučk z ArduinomPrižiganje lučk z Arduinom
Prižiganje lučk z Arduinom
Maja Kraljič
 
Ada Lovelace Day 2017
Ada Lovelace Day 2017Ada Lovelace Day 2017
Ada Lovelace Day 2017
Maja 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 Ubuntu
Maja Kraljič
 

More from 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
 

Recently uploaded

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

[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