Heres how the monsters relate to each other.
Saber and Fig are the top predators. They rule over the other two; Fig with its cunning and Saber with brute force.
When shrimp is under threat from the predators it shivers in fear and uses its speed to escape. Otherwise it lives its life in constant fear; motivated only by the ball of food it eats and shits out.
Blob starts lighting up as a threat display to the predators. It is too lazy to move itself. It eats the lice that feed on Saber.
Saturday, January 30, 2010
Character Development- Monster No.4
Saber (for now) is the scariest monster. The very sight of it and the other creatures make a hasty retreat. It is larger and towers over the other creatures. It doesn't really need to be a strategic hunter as the rest are no match for its strength.
There are lice that camouflage and live on its legs. It is unaware of these lice and can barely see them. Blob feeds on these Lice.
There are lice that camouflage and live on its legs. It is unaware of these lice and can barely see them. Blob feeds on these Lice.
Character Development- Monster No.3
Fig (for now) is a cunning predator. On the outside it is a dull mossy pod but it opens out its vibrant petals to attract pray. It lays there deceptively beautiful and calm until prey swims near enough. Then its strikes and traps the prey with its frog like tongue. Once the prey is caught the pod closes up.
Character Development- Monster No.2
Shrimp (for now) is a swift, energetic creature. Its always watching its back and slithers away hastily at the smallest hint of danger. It gets scared easily and shivers when it senses a predator.Its a simple creature that eats simple food and shits it out. Its speed is an asset that helps it outrun predators.
Character Development- monster no.1
This monster who for now is called Blob. Its a lazy bored lump. It believes its dull life has no purpose. It'll drag itself sideways an inch or 2 on the rare occasion it feels inspired to do so. Even when a predator comes along it makes an effort to escape but gives up soon enough. It sits put and starts glowing and lighting up in a lame threat to keep the predator away.
Friday, January 22, 2010
Combining Codes
Here I used the Reed switch to turn on and off a motor (cell phone vibrator) and a set of LEDs. The LEDs are being run on a variation the Knightrider Tutorial from the Arduino website.
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
const int motorPin = 8; // the number oh the motor pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int timer = 100;
int timer2 = 1000;
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the motor as as output
pinMode(motorPin, OUTPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
Serial.begin(9600);
}
void loop(){
// read the state of the reedswitch value:
buttonState = digitalRead(buttonPin);
// check if the reedswitch is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn motor on
digitalWrite(motorPin, HIGH);
delay(timer2);
digitalWrite(motorPin, LOW);
delay(timer);
// turn LED on:
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
Serial.println("ON");
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
}
else {
// turn motor off:
digitalWrite(motorPin, LOW);
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
Serial.println("OFF");
}
}
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
const int motorPin = 8; // the number oh the motor pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int timer = 100;
int timer2 = 1000;
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the motor as as output
pinMode(motorPin, OUTPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
Serial.begin(9600);
}
void loop(){
// read the state of the reedswitch value:
buttonState = digitalRead(buttonPin);
// check if the reedswitch is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn motor on
digitalWrite(motorPin, HIGH);
delay(timer2);
digitalWrite(motorPin, LOW);
delay(timer);
// turn LED on:
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
Serial.println("ON");
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
}
else {
// turn motor off:
digitalWrite(motorPin, LOW);
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
Serial.println("OFF");
}
}
Simple Reed Switch Circuit
Ive taken the code from the adruino tutorials- Button: use a pushbutton to control an LED.
I just replaced the Push Button switch with a Reed Switch i.e. a magnetic switch. The contacts close and complete the circuit when a magnet is brought near it.
Simple Reed Switch Adruino Code
// set pin numbers:
const int buttonPin = 3; // the number of the reedswitch pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the reedswitch value:
buttonState = digitalRead(buttonPin);
// check if the reedswitch is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
Tuesday, January 19, 2010
Monday, January 18, 2010
Initial Toy concept
The Inspiration
Subscribe to:
Posts (Atom)