Skip to content

Commit f0adea5

Browse files
author
richelbilderbeek
committed
Update
1 parent 27547ec commit f0adea5

File tree

6 files changed

+175
-172
lines changed

6 files changed

+175
-172
lines changed

activities/20231209_slutpresentation/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ Vem |Ålder|Kurs|Vad
3838
Dahlia |8 |P |Vacker regenb...
3939
Angela |9 |A |Neopixel
4040
Enrico |9 |P |Random röd
41-
Gordii |9 |A |Blink
42-
Shushanti |9 |P |Färger
41+
?Gordii |9 |A |Blink
42+
?Shushanti |9 |P |Färger
4343
Xiuchang |9 |P |Random
44-
Fredrik |? |B |Wackamole
45-
Daniel |10 |P |Grässmatta Quest
44+
?Fredrik |? |B |Wackamole
45+
Daniel |10 |P |Gräsmatta Quest
46+
Kevin |10 |P |Physics Engine
4647
Sannan |10 |B |Igndominus
4748
Vide |11 |B |Rabbit hat
4849
Teo |12 |P |Pizza
4950
WALL-E 38 |? |ABP |WALL-E 38
5051
Team Smile.exe.co TM |11 |B |Battle Island
5152
Team Smile.exe.co TM |. |B |Davidsgoofyahhtree
53+
Felipe och Pablo's lag|11 |P |Studsar
5254
Isaac's lag mkn |11 |P |Halcony Infynity
5355
UFO |13 |P |UFO 2D2
5456

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 326db25aca558710ac8c66c003545b880a45fc59
1+
Subproject commit 44ecc6cbe65ba8c5ea4969e45c50c8930bb537b5
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,167 @@
1-
float [][] position;
2-
import ddf.minim.*;
3-
Minim minim;
4-
AudioPlayer player;
5-
PImage bild;
6-
PImage bild2;
7-
float x = 0;
8-
float x5 = -50;
9-
float y5 = -50;
10-
float y = 0;
11-
float copies = 200;
12-
float size = 50;
13-
float speedX = 0;
14-
float speedY = 0;
15-
float spelplanX = 0;
16-
float spelplanY = 0;
17-
float enemySpeedX = 1;
18-
float enemySpeedY = 1;
19-
float eyeX = x;
20-
float eyeY = y;
21-
float eX = 0;
22-
float eY = 0;
23-
boolean[] keys;
24-
void setup()
25-
{
26-
minim = new Minim(this);
27-
player= minim.loadFile("t.mp3");
28-
bild2 = loadImage("mus.png");
29-
noCursor();
30-
fullScreen();
31-
x = width / 2 - 25;
32-
y = height / 2 - 25;
33-
eyeX = x + 15;
34-
eyeY = y + 15;
35-
bild = loadImage("grass.png");
36-
keys = new boolean[2048];
37-
position = new float[64][5];
38-
for(int i=0;i<position.length;i++){
39-
position[i][2]=0;
40-
}
41-
/*
42-
[i][0] = X
43-
[i][1] = Y
44-
[i][2] = Draw?
45-
[i][3] = Width
46-
[i][4] = Height
47-
*/
48-
}
49-
void draw()
50-
{
51-
player.play();
52-
if (spelplanX > 0) spelplanX-= 100;
53-
if (spelplanX + width / 10 < 0) spelplanX += 100;
54-
if (spelplanY > 0) spelplanY-= 100;
55-
if (spelplanY + width / 10 < 0) spelplanY += 100;
56-
if (eX < x + 25) eX = eX + 1;
57-
if (eX > x + 25) eX = eX - 1;
58-
if (eY > y + 25) eY -= 1;
59-
if (eY < y + 25) eY += 1;
60-
fill(0, 180, 0);
61-
if (dist(eX, eY, x + 25 , y + 25) < 50) exit();
62-
stroke(0, 255, 0);
63-
fill(255, 255, 255);
64-
65-
fill(255, 0, 0);
66-
image(bild, spelplanX, spelplanY);
67-
ellipse(eX, eY, 50, 50);
68-
for (int i = 0; i > 200; ++i)
69-
{
70-
ellipse(spelplanX, spelplanY, 100, 100);
71-
spelplanX += 100;
72-
}
73-
player.play();
74-
fill(0, 0, 0);
75-
rect(x, y, size , size);
76-
fill(255, 0, 0);
77-
fill(255, 255, 255);
78-
ellipse(eyeX, eyeY, 20, 20);
79-
fill(0, 0, 0);
80-
ellipse(eyeX, eyeY, 10, 10);
81-
makeRect(x5,y5,150,150);
82-
83-
for(int i=0;i<position.length;i++){
84-
if(position[i][2]==1){
85-
rect(position[i][0], position[i][1], position[i][3], position[i][4]);
86-
}
87-
88-
position[i][2]=0;
89-
}
90-
image(bild2, mouseX, mouseY);
91-
k();
92-
}
93-
void makeRect(float X, float Y, float Width, float Height){
94-
int i=0;
95-
for(i=0;i<position.length-1&&(position[i][2]==1);i++){
96-
}
97-
position[i][0]=X;
98-
position[i][2]=1;
99-
position[i][3]=Width;
100-
position[i][4]=Height;
101-
}
102-
void keyPressed(){
103-
keys[keyCode]=true;
104-
println(keyCode);
105-
}
106-
void keyReleased(){
107-
keys[keyCode]=false;
108-
}
109-
void k()
110-
{
111-
if (keyPressed)
112-
{
113-
if (key == 'e')
114-
{
115-
exit();
116-
}
117-
if (keys[38])
118-
{
119-
y5 += 3;
120-
spelplanY = spelplanY + 3;
121-
eyeY = height / 2 - 10;
122-
eyeX = width / 2;
123-
eY += 2;
124-
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
125-
spelplanY -= 3;
126-
y5 -=3;
127-
}
128-
}
129-
if (keys[40])
130-
{
131-
spelplanY = spelplanY - 3;
132-
eyeY = height / 2 + 10;
133-
eyeX = width / 2;
134-
eY -= 2;
135-
y5 -= 3;
136-
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
137-
spelplanY += 3;
138-
y5 += 3;
139-
}
140-
}
141-
if (keys[37])
142-
{
143-
x5 += 3;
144-
spelplanX = spelplanX + 3;
145-
eyeX = width / 2 - 10;
146-
eyeY = height / 2;
147-
eX += 2;
148-
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
149-
spelplanX -= 3;
150-
x5 -= 3;
151-
}
152-
}
153-
if (keys[39])
154-
{
155-
x5 -= 3;
156-
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
157-
spelplanX += 3;
158-
x5 += 3;
159-
}
160-
spelplanX = spelplanX - 3;
161-
eyeX = width / 2 + 10;
162-
eyeY = height / 2;
163-
eX -= 2;
164-
}
165-
}
166-
}
1+
float [][] position;
2+
import ddf.minim.*;
3+
Minim minim;
4+
AudioPlayer player;
5+
PImage bild;
6+
PImage bild2;
7+
float x = 0;
8+
float x5 = -50;
9+
float y5 = -50;
10+
float y = 0;
11+
float copies = 200;
12+
float size = 50;
13+
float speedX = 0;
14+
float speedY = 0;
15+
float spelplanX = 0;
16+
float spelplanY = 0;
17+
float enemySpeedX = 1;
18+
float enemySpeedY = 1;
19+
float eyeX = x;
20+
float eyeY = y;
21+
float eX = 0;
22+
float eY = 0;
23+
boolean[] keys;
24+
void setup()
25+
{
26+
minim = new Minim(this);
27+
player= minim.loadFile("t.mp3");
28+
bild2 = loadImage("mus.png");
29+
noCursor();
30+
fullScreen();
31+
x = width / 2 - 25;
32+
y = height / 2 - 25;
33+
eyeX = x + 15;
34+
eyeY = y + 15;
35+
bild = loadImage("grass.png");
36+
keys = new boolean[2048];
37+
position = new float[64][5];
38+
for(int i=0;i<position.length;i++){
39+
position[i][2]=0;
40+
}
41+
/*
42+
[i][0] = X
43+
[i][1] = Y
44+
[i][2] = Draw?
45+
[i][3] = Width
46+
[i][4] = Height
47+
*/
48+
}
49+
void draw()
50+
{
51+
player.play();
52+
if (spelplanX > 0) spelplanX-= 100;
53+
if (spelplanX + width / 10 < 0) spelplanX += 100;
54+
if (spelplanY > 0) spelplanY-= 100;
55+
if (spelplanY + width / 10 < 0) spelplanY += 100;
56+
if (eX < x + 25) eX = eX + 1;
57+
if (eX > x + 25) eX = eX - 1;
58+
if (eY > y + 25) eY -= 1;
59+
if (eY < y + 25) eY += 1;
60+
fill(0, 180, 0);
61+
if (dist(eX, eY, x + 25 , y + 25) < 50) exit();
62+
stroke(0, 255, 0);
63+
fill(255, 255, 255);
64+
65+
fill(255, 0, 0);
66+
image(bild, spelplanX, spelplanY);
67+
ellipse(eX, eY, 50, 50);
68+
for (int i = 0; i > 200; ++i)
69+
{
70+
ellipse(spelplanX, spelplanY, 100, 100);
71+
spelplanX += 100;
72+
}
73+
player.play();
74+
fill(0, 0, 0);
75+
rect(x, y, size , size);
76+
fill(255, 0, 0);
77+
fill(255, 255, 255);
78+
ellipse(eyeX, eyeY, 20, 20);
79+
fill(0, 0, 0);
80+
ellipse(eyeX, eyeY, 10, 10);
81+
makeRect(x5,y5,150,150);
82+
83+
for(int i=0;i<position.length;i++){
84+
if(position[i][2]==1){
85+
rect(position[i][0], position[i][1], position[i][3], position[i][4]);
86+
}
87+
88+
position[i][2]=0;
89+
}
90+
image(bild2, mouseX, mouseY);
91+
k();
92+
}
93+
void makeRect(float X, float Y, float Width, float Height){
94+
int i=0;
95+
for(i=0;i<position.length-1&&(position[i][2]==1);i++){
96+
}
97+
position[i][0]=X;
98+
position[i][1]=Y;
99+
position[i][2]=1;
100+
position[i][3]=Width;
101+
position[i][4]=Height;
102+
}
103+
void keyPressed(){
104+
keys[keyCode]=true;
105+
println(keyCode);
106+
}
107+
void keyReleased(){
108+
keys[keyCode]=false;
109+
}
110+
void k()
111+
{
112+
if (keyPressed)
113+
{
114+
if (key == 'e')
115+
{
116+
exit();
117+
}
118+
if (keys[38])
119+
{
120+
y5 += 3;
121+
spelplanY = spelplanY + 3;
122+
eyeY = height / 2 - 10;
123+
eyeX = width / 2;
124+
eY += 2;
125+
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
126+
spelplanY -= 3;
127+
y5 -=3;
128+
}
129+
}
130+
if (keys[40])
131+
{
132+
spelplanY = spelplanY - 3;
133+
eyeY = height / 2 + 10;
134+
eyeX = width / 2;
135+
eY -= 2;
136+
y5 -= 3;
137+
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
138+
spelplanY += 3;
139+
y5 += 3;
140+
}
141+
}
142+
if (keys[37])
143+
{
144+
x5 += 3;
145+
spelplanX = spelplanX + 3;
146+
eyeX = width / 2 - 10;
147+
eyeY = height / 2;
148+
eX += 2;
149+
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
150+
spelplanX -= 3;
151+
x5 -= 3;
152+
}
153+
}
154+
if (keys[39])
155+
{
156+
x5 -= 3;
157+
if (dist(x5 + 100, y5 + 100, x + 50 , y + 50) < 125){
158+
spelplanX += 3;
159+
x5 += 3;
160+
}
161+
spelplanX = spelplanX - 3;
162+
eyeX = width / 2 + 10;
163+
eyeY = height / 2;
164+
eX -= 2;
165+
}
166+
}
167+
}

activities/20231209_slutpresentation/emil_servo/emil_servo.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Servo min_servo;
33

44
void setup() {
55
// put your setup code here, to run once:
6-
Serial.begin(9600);23
6+
Serial.begin(9600);
77

88
min_servo.attach(9);
99
}
Binary file not shown.

0 commit comments

Comments
 (0)