-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b418639
commit dbb1633
Showing
33 changed files
with
5,832 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
...tation/first/emil/sketch_may10a_copy_20240511105733/sketch_may10a_copy_20240511105733.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <servo.h> | ||
servo myservo; | ||
int const potpin = AO; | ||
int potval; | ||
int angel; | ||
void setup() { | ||
myServo.attach(9); | ||
Serial.begin(9600); | ||
} | ||
void loop() { | ||
potval = analogRead(potpin); | ||
serial.prin("potval: "); | ||
|
||
|
||
|
||
void loop() | ||
// put your main code here, to run repeatedly: | ||
|
||
} |
Binary file added
BIN
+1010 KB
activities/20240518_slutpresentation/first/rees/old/smiley face.blend
Binary file not shown.
Binary file modified
BIN
+7.5 MB
(860%)
activities/20240518_slutpresentation/first/rees/smiley face.blend
Binary file not shown.
28 changes: 28 additions & 0 deletions
28
activities/20240518_slutpresentation/second/Dependent/Bullet.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class Bullet { | ||
float x, y, xv, yv; | ||
boolean running = false; | ||
|
||
Bullet(float x, float y, float d, float v) { | ||
this.x = x; | ||
this.y = y; | ||
this.xv = v * cos(d); | ||
this.yv = v * sin(d); | ||
running = true; | ||
} | ||
Bullet(float x, float y, float d, float v, boolean r) { | ||
this.x = x; | ||
this.y = y; | ||
this.xv = v * cos(d); | ||
this.yv = v * sin(d); | ||
running = r; | ||
} | ||
|
||
void display() { | ||
MainGraphic.stroke(#B47600); | ||
MainGraphic.strokeWeight(3); | ||
MainGraphic.line(x - entities.camX, y - entities.camY, x-xv - entities.camX, y-yv - entities.camY); | ||
|
||
x += xv; | ||
y += yv; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
activities/20240518_slutpresentation/second/Dependent/Button.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
|
||
class Button { | ||
float x, y, w, h; | ||
int state; | ||
String label; | ||
|
||
Button(float x, float y, float w, float h, String label) { | ||
this.x = x; | ||
this.y = y; | ||
this.w = w; | ||
this.h = h; | ||
this.label = label; | ||
} | ||
|
||
boolean isPressed() { | ||
if(mousePressed && mouseButton == LEFT && mouseX > x && mouseY > y && mouseX < x + w && mouseY < y + h) return true; | ||
|
||
return false; | ||
} | ||
|
||
void display() { | ||
fill(255 - int(mousePressed && mouseButton == LEFT && mouseX > x && mouseY > y && mouseX < x + w && mouseY < y + h) * 100); | ||
stroke(0); | ||
rect(x, y, w, h); | ||
textAlign(LEFT, TOP); | ||
textSize(32); | ||
fill(0); | ||
text(label, x + 1, y + 2); | ||
if(isPressed() && state == 1) state = 2; | ||
if(isPressed() && state == 0) state = 1; | ||
if(state == 3) state = 0; | ||
if(!isPressed() && (state == 1 || state == 2)) state = 3; | ||
} | ||
} |
Oops, something went wrong.