Hey guys,
I want to run two Sketches, so i can use two output-windows instead of just one.
I tried to do it in one Sketch, using a frameclass, but its not that clean and not working that great..
What is the easiest way to send variables from one sketch to another?
import oscP5.*; import netP5.*;
OscP5 oscP5; NetAddress myBroadcastLocation;
void setup() { size(500,700); noStroke();
oscP5 = new OscP5(this,12000); myBroadcastLocation = new NetAddress("127.0.0.1",12000);
}
void draw() {
}
void mousePressed(){ OscMessage myMessage = new OscMessage("theValue");
/* send the message */ oscP5.send(myMessage, myBroadcastLocation);
}
import oscP5.*; import netP5.*;
ArrayList objects; int count = 0 ;
OscP5 oscP5; NetAddress myRemoteLocation;
void setup() {
oscP5 = new OscP5(this,12000); myRemoteLocation = new NetAddress("127.0.0.1",12000);
}
void draw() {
}
void oscEvent(OscMessage theOscMessage) { // get the first value as an integer int firstValue = theOscMessage.get(0).intValue();
Heyho,
Im trying to send some variables from PureData to Processing.
Everything is working fine, when i only send one variable - but if i try to send more then one, i get some issues.
Do I have a mistake in my synthax?! :-/
Screenshot attached.
Im trying to programm a little game, where i need some interfacegraphics.
The red color of the brain (image attached) shall get smaller, if the player gets hit.
map() should be a good option for that, but i have to crop the image of the brain and not just change the width..
Any ideas how to solve that? Is there a function, which crops my image :o?
Hi,
My english isnt that fine, sorry for that ;)
Im trying to program a little game with processing. Its my first experience in programing, so my code is kind of ugly.
We havnt learned to use classes and stuff so far, so i tried to code it just by using the draw function.
The game starts with a countdown, counting from 3 to a random number. First part of the game is about reacting. After that the faster player have to aim at the opponent. If he hits, player 2 should loose a life and the countdown shall start again. So i thought, i could just write in the "hitOrNot" if-function, that the countdown shall start again (start=false). But it doesnt work.. the timer is working fine, but there is no visual output. Its working if i write
println("1") instead of
text("3", 400, 300); but thats not what i want... is there a way to do it, without changing all of my code? I know that its really confusing .. :S I hope u get what i mean =(
int sec ; int msec; int cdLastNumber = int(random(7, 22)); int winner = 0;