I've been searching around trying to figure out how to do this but alas I can't figure it out :( I am trying to send data from Arduino to processing and have processing spit out a text file that I will then have Arduino read. I have 8 RGB LEDS with 3 shift registers, a DHT Temp Sensor, a photoresistor, and an electret microphone. The input from the 3 senors are controlling the color of the RGB LEDS. My code on the Arduino side works but I can't get processing to read the data and save it to a text file. Here is my code so far (it's probably all wrong, I'm new to programming)
import processing.serial.*; Serial myPort; PrintWriter output; int r; int g; int b;
Thanks to the help from GoToLoop, I have my game *ALMOST* working ^^. But I am having trouble setting up a scoring system for the game. I also need to make the game "end" after 20 seconds. Can anyone help me? Its very urgent! Here's the link to the code because the game has many images
Hi, I am a new programming student and for my school final, I am working on a mini game, where you have to shoot werewolves in a set amount of time. How can I make it so that the werewolf image is a button that you can click on it and after you click on it twice, it disappears? Really need the help, I have the girl shooting and the werewolf walking. Download in comment below >_<
//DECLARING OBJECTS Werewolf werewolf;
//BACKGROUND
float r = 0.8; PImage bg;
//SHOOT LEFT
PImage shootleft;
//SHOOT RIGHT
PImage shootright;
//STAND
float v = 0.5; PImage standleft; PImage standright;
//SETUP
void setup() {
size (650, 700); bg = loadImage ("bg_0.png"); //load background standleft = loadImage ("stand_left.png"); //load standing left image standright = loadImage ("stand_right.png"); //load standing right image shootleft= loadImage ("shoot_left.png"); //load shooting left image shootright= loadImage ("shoot_right.png"); //load shooting right image werewolf = new Werewolf(); //load werewolf class }
class Werewolf { float life; //life counter int walk; //walk 8 images int imageIndex; // start at image 0 int die; // death 7 images int imageIndextwo; //start at image 0 float movement; //movement counter float sizewolf; //scale wolf down int xtwo; // x variable for position PImage [] wolf; //wolf image walking to the left PImage [] death; //death image walking to the left boolean hit; float tempX; float tempY; float tempW; float tempH;
Werewolf() { life = 2; walk = 8; die = 7; imageIndex = 0; imageIndextwo = 0; movement = 3; sizewolf = 0.9; tempX = 0; tempY = 0; tempW = 0; tempH = 0; xtwo = 0; wolf = new PImage [walk]; //left walk death = new PImage [die]; // left death hit = false;
for (int w = 0; w < wolf.length; w ++) { wolf[w] = loadImage("wolf_walk_" + w + ".png"); }