1274 lines
54 KiB
Java
1274 lines
54 KiB
Java
|
package com.droidquest.levels;
|
||
|
|
||
|
import java.awt.Color;
|
||
|
|
||
|
import com.droidquest.Room;
|
||
|
import com.droidquest.RoomDisplay;
|
||
|
import com.droidquest.Wire;
|
||
|
import com.droidquest.avatars.HelpCam;
|
||
|
import com.droidquest.avatars.LabCursor;
|
||
|
import com.droidquest.avatars.Remote;
|
||
|
import com.droidquest.avatars.SolderingPen;
|
||
|
import com.droidquest.chipstuff.Port;
|
||
|
import com.droidquest.decorations.Arrow;
|
||
|
import com.droidquest.devices.ANDGate;
|
||
|
import com.droidquest.devices.Antenna;
|
||
|
import com.droidquest.devices.ContactSensor;
|
||
|
import com.droidquest.devices.DirectionalSensor;
|
||
|
import com.droidquest.devices.FlipFlop;
|
||
|
import com.droidquest.devices.NOTGate;
|
||
|
import com.droidquest.devices.Node;
|
||
|
import com.droidquest.devices.ORGate;
|
||
|
import com.droidquest.devices.PortDevice;
|
||
|
import com.droidquest.devices.RoomSensor;
|
||
|
import com.droidquest.devices.Thruster;
|
||
|
import com.droidquest.devices.XORGate;
|
||
|
import com.droidquest.items.BlueRobot;
|
||
|
import com.droidquest.items.Button;
|
||
|
import com.droidquest.items.Crystal;
|
||
|
import com.droidquest.items.Key;
|
||
|
import com.droidquest.items.OrangeRobot;
|
||
|
import com.droidquest.items.SentryT2;
|
||
|
import com.droidquest.items.ToolBox;
|
||
|
import com.droidquest.items.WhiteRobot;
|
||
|
import com.droidquest.materials.CrystalRecharger;
|
||
|
import com.droidquest.materials.Material;
|
||
|
import com.droidquest.materials.Portal;
|
||
|
|
||
|
class ROTut2 extends Level
|
||
|
{
|
||
|
|
||
|
public ROTut2(RoomDisplay rd)
|
||
|
{
|
||
|
super(rd);
|
||
|
|
||
|
// Material 0, Blank
|
||
|
materials.addElement(new Material(true, false));
|
||
|
// Material 1, Green Wall
|
||
|
materials.addElement(new Material(new Color(0,255,0),false, true));
|
||
|
// Material 2, Blue Wall
|
||
|
materials.addElement(new Material(new Color(0,0,255),false, true));
|
||
|
// Material 3, Light Blue Wall
|
||
|
materials.addElement(new Material(new Color(190,190,255),false,true));
|
||
|
// Material 4, Dark Blue Wall
|
||
|
materials.addElement(new Material(new Color(0,0,128),false, true));
|
||
|
// Material 5, Recharger
|
||
|
materials.addElement(new CrystalRecharger());
|
||
|
// Material 6, Portal to Tutorial 3;
|
||
|
materials.addElement(new Portal("ROTut3.lvl",false, true));
|
||
|
// Material 7, Portal to Main Menu;
|
||
|
materials.addElement(new Portal("MainMenu.lvl",false, true));
|
||
|
|
||
|
for (int a=0; a<42; a++)
|
||
|
rooms.addElement(new Room());
|
||
|
|
||
|
{ // Room 0, Help Screen
|
||
|
Room room = (Room) rooms.elementAt(0);
|
||
|
int[][] table = {
|
||
|
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
||
|
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Special Keys",6*28, 2*32, 500);
|
||
|
room.AddTextBox("R Become the Remote Control. SPACEBAR toggles on/off.",
|
||
|
2*28, 3*32, 500);
|
||
|
room.AddTextBox("S Become the Solderpen. SPACEBAR toggles on/off.",
|
||
|
2*28, 5*32, 500);
|
||
|
room.AddTextBox("C Become the Cursor. SPACEBAR toggles on/off.",
|
||
|
2*28, 7*32, 500);
|
||
|
room.AddTextBox("T Summons Toolkit to your room. Open/close Toolkit in room.",
|
||
|
2*28, 9*32, 500);
|
||
|
room.AddTextBox("To continue, press RETURN.", 4*28, 11*32, 500);
|
||
|
}
|
||
|
{ // Room 1, Title Screen
|
||
|
Room room = (Room) rooms.elementAt(1);
|
||
|
int[][] table = {
|
||
|
{2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("{BIG} TOOLKIT", 6*28, 2*32, 500);
|
||
|
room.AddTextBox("Here you will learn to use the",
|
||
|
2*28, 3*32, 500);
|
||
|
room.AddTextBox("- Remote Control", 6*28, 5*32, 500);
|
||
|
room.AddTextBox("- Solderpen", 6*28, 6*32, 500);
|
||
|
room.AddTextBox("- Toolkit", 6*28, 7*32, 500);
|
||
|
room.AddTextBox("If you don't know about ROBOT ANATOMY, return to the Main Menu by using the menubar.",
|
||
|
2*28, 9*32, 500);
|
||
|
room.AddArrow(559,7*32+16, Arrow.DIR_RIGHT, 28, Color.white) ;
|
||
|
}
|
||
|
{ // Room 2, Remote
|
||
|
Room room = (Room) rooms.elementAt(2);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("This is the REMOTE CONTROL. It 'freezes' the flow of electricity.",
|
||
|
2*28, 2*32, 400);
|
||
|
room.AddTextBox("Press R to become the Remote Control.",
|
||
|
2*28, 6*32, 300);
|
||
|
room.AddArrow(559,7*32+16, Arrow.DIR_RIGHT, 28, Color.white) ;
|
||
|
Remote remote = new Remote();
|
||
|
remote.x = 17*28+14; remote.y = 48; remote.room = room;
|
||
|
items.addElement(remote);
|
||
|
}
|
||
|
{ // Room 3, Freeze Electricity
|
||
|
Room room = (Room) rooms.elementAt(3);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Press SPACEBAR to 'freeze' the electricity. The Remote Control turns white.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("Press SPACEBAR again to let electricity flow. The Remote Control turns orange.",
|
||
|
2*28, 10*32, 500);
|
||
|
room.AddArrow(559,7*32+16, Arrow.DIR_RIGHT, 28, Color.white) ;
|
||
|
Node node = new Node(10*28,4*32,room, Node.TYPE_STRAIGHT);
|
||
|
NOTGate notgate = new NOTGate(15*28, 6*32, room);
|
||
|
items.addElement(node);
|
||
|
items.addElement(notgate);
|
||
|
Wire wire = new Wire(node.ports[0], notgate.ports[1]);
|
||
|
wire = new Wire(notgate.ports[0], node.ports[2]);
|
||
|
}
|
||
|
{ // Room 4, Freeze Robot
|
||
|
Room room = (Room) rooms.elementAt(4);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Freeze the electricity to stop the robot.",
|
||
|
9*28, 2*32, 300);
|
||
|
room.AddTextBox("Turn on the elec- tricity and the robot moves.",
|
||
|
9*28, 5*32, 300);
|
||
|
room.AddTextBox("When the Remote Control is on, it drains electricity from the Robot's battery.",
|
||
|
9*28, 8*32, 300);
|
||
|
room.AddArrow(559,6*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
items.addElement(new Crystal(3*28, 10*32, room, 100000));
|
||
|
OrangeRobot robot = new OrangeRobot(28,32,room);
|
||
|
items.addElement(robot);
|
||
|
RoomSensor sensor = new RoomSensor(6*28, 6*32, robot.InternalRoom,
|
||
|
new Crystal(0,0,null,0));
|
||
|
items.addElement(sensor);
|
||
|
sensor.rotate(1); sensor.rotate(1);
|
||
|
Wire wire = new Wire(sensor.ports[0], robot.devices[8].ports[0]);
|
||
|
wire = new Wire(robot.devices[5].ports[0], robot.devices[2].ports[0]);
|
||
|
wire = new Wire(robot.devices[3].ports[0], robot.devices[6].ports[0]);
|
||
|
wire = new Wire(robot.devices[7].ports[0], robot.devices[0].ports[0]);
|
||
|
wire = new Wire(robot.devices[1].ports[0], robot.devices[4].ports[0]);
|
||
|
robot.thrusterPower=true;
|
||
|
}
|
||
|
{ // Room 5, Freeze Sensors
|
||
|
Room room = (Room) rooms.elementAt(5);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Freeze the electricity again. Press C to become the cursor. Pick up the sensor and move it around the crystal.",
|
||
|
2*28, 2*32, 450);
|
||
|
room.AddTextBox("Did the outputs change color?",
|
||
|
2*28, 5*32, 200);
|
||
|
room.AddTextBox("Sensors don't work when the remote control is off.",
|
||
|
2*28, 8*32, 350);
|
||
|
room.AddTextBox("Turn the remote contol on.",
|
||
|
2*28, 11*32, 500);
|
||
|
room.AddArrow(559,9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
items.addElement(new Crystal(12*28, 4*32, room, 100000));
|
||
|
items.addElement(new DirectionalSensor(15*28, 6*32, room,
|
||
|
new Crystal(0,0,null,0)));
|
||
|
}
|
||
|
{ // Room 6, Solderpen
|
||
|
Room room = (Room) rooms.elementAt(6);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("The SOLDERPEN is used to wire OUTPUTS to INPUTS.",
|
||
|
2*28, 2*32, 350);
|
||
|
room.AddTextBox("Press S to become the Solderpen.",
|
||
|
2*28, 5*32, 400);
|
||
|
room.AddTextBox("Tip",
|
||
|
14*28+8, 3*32-12, 50);
|
||
|
room.AddArrow(16*28+24, 2*32+14, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(17*28, 383, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
SolderingPen sp = new SolderingPen();
|
||
|
items.addElement(sp);
|
||
|
sp.x = 17*28; sp.y=2*32-8; sp.room = room;
|
||
|
}
|
||
|
{ // Room 7, Attach wires
|
||
|
Room room = (Room) rooms.elementAt(7);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Move the Solderpen to the INPUT (circle) until the Solderpen tip glows orange. Press SPACEBAR.",
|
||
|
2*28, 2*32, 400);
|
||
|
room.AddTextBox("Move the Solderpen to the OUTPUT (arrow). When the tip glows orange, press SPACEBAR. The INPUT is now wired to the OUTPUT and electricity flows between them.",
|
||
|
2*28, 7*32, 400);
|
||
|
room.AddArrow(0, 5*32+16, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
items.addElement(new Thruster(17*28, 9*32, room, Port.ROT_RIGHT, Color.white));
|
||
|
PortDevice pd = new PortDevice(15*28, 10*32, room, 28, Port.TYPE_OUTPUT);
|
||
|
pd.value=true;
|
||
|
items.addElement(pd);
|
||
|
}
|
||
|
{ // Room 8, Detatch wires
|
||
|
Room room = (Room) rooms.elementAt(8);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("To disconnect the wire, move near the INPUT or OUTPUT. Press the SPACEBAR when the tip glows green.",
|
||
|
2*28, 2*32, 400);
|
||
|
room.AddArrow(0, 9*32+16, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
Thruster thruster = new Thruster(17*28, 9*32, room, Port.ROT_RIGHT, Color.white);
|
||
|
items.addElement(thruster);
|
||
|
PortDevice pd = new PortDevice(15*28, 10*32, room, 28, Port.TYPE_OUTPUT);
|
||
|
pd.value=true;
|
||
|
items.addElement(pd);
|
||
|
Wire wire = new Wire(thruster.ports[0], pd.ports[0]);
|
||
|
}
|
||
|
{ // Room 9, Stretch Wires
|
||
|
Room room = (Room) rooms.elementAt(9);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("When you connect inputs to outputs, you create CIRCUITS.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("Change to the cursor and pick up part of this circuit.",
|
||
|
2*28, 4*32, 500);
|
||
|
room.AddTextBox("The wire will stretch as you move, but break if you leave the room.",
|
||
|
2*28, 6*32, 500);
|
||
|
room.AddArrow(0, 9*32+16, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
NOTGate ng = new NOTGate(15*28, 7*32, room);
|
||
|
ORGate og = new ORGate(10*28, 7*32, room);
|
||
|
og.rotate(1); og.rotate(1);
|
||
|
items.addElement(ng);
|
||
|
items.addElement(og);
|
||
|
Wire wire = new Wire(ng.ports[1], og.ports[0]);
|
||
|
wire = new Wire(og.ports[2], ng.ports[0]);
|
||
|
}
|
||
|
{ // Room 10, Stretch Wires
|
||
|
Room room = (Room) rooms.elementAt(10);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Practice wiring circuits in the orange robot above. (Don't forget to come back!)",
|
||
|
2*28, 2*32, 400);
|
||
|
room.AddTextBox("Go inside the robot and rewire the bumpers to the thrusters in any way you like.",
|
||
|
2*28, 5*32, 400);
|
||
|
room.AddTextBox("To start the robot moving, put it against a wall.",
|
||
|
2*28, 8*32, 400);
|
||
|
room.AddArrow(0, 9*32+16, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 11, Toolkit is here
|
||
|
Room room = (Room) rooms.elementAt(11);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("This is the TOOLKIT. Inside are parts you need to wire circuits.",
|
||
|
2*28, 2*32, 400);
|
||
|
room.AddTextBox("Press C to become the cursor and pick up the Toolkit.",
|
||
|
2*28, 5*32, 400);
|
||
|
room.AddTextBox("Carry it into the next room.",
|
||
|
2*28, 8*32, 400);
|
||
|
room.AddArrow(3*28, 383, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
toolbox = new ToolBox(15*28, 2*32, room);
|
||
|
items.addElement(toolbox);
|
||
|
}
|
||
|
{ // Room 12, Open and Close Toolkit
|
||
|
Room room = (Room) rooms.elementAt(12);
|
||
|
int[][] table = {
|
||
|
{3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Drop Toolkit here.",
|
||
|
4*28, 4*32, 100);
|
||
|
room.AddTextBox("You can open and close the Toolkit by pressing T. Try it a few times.",
|
||
|
2*28, 7*32, 300);
|
||
|
room.AddTextBox("Leave the Toolkit here.",
|
||
|
2*28, 10*32, 400);
|
||
|
room.AddArrow(9*28, 5*32, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 13, Toolkit Sentry
|
||
|
Room room = (Room) rooms.elementAt(13);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,3,3,0,0,3,3,3,3,3,3,0,0,3},
|
||
|
{3,0,0,3,3,0,0,3,3,0,0,3,3,3,3,3,3,0,0,0},
|
||
|
{3,0,0,3,3,0,0,3,3,0,0,3,3,0,0,3,3,0,0,0},
|
||
|
{3,0,0,3,3,0,0,3,3,0,0,3,3,0,0,3,3,0,0,0},
|
||
|
{3,0,0,3,3,0,0,3,3,0,0,3,3,0,0,3,3,0,0,0},
|
||
|
{0,0,0,3,3,0,0,0,0,0,0,3,3,0,0,0,0,0,0,3},
|
||
|
{0,0,0,3,3,0,0,0,0,0,0,3,3,0,0,0,0,0,0,3},
|
||
|
{0,0,0,3,3,0,0,0,0,0,0,3,3,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("NO TOOLKITS ALLOWED!",
|
||
|
2*28, 2*32, 150);
|
||
|
room.AddArrow(559, 6*32, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
items.add(new SentryT2(2*28, 2*32, room));
|
||
|
}
|
||
|
{ // Room 14, Summon Toolkit
|
||
|
Room room = (Room) rooms.elementAt(14);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Do you want the Toolkit? Press T to summon it. Drop the Toolkit and press T to open and close it.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 15, Objects in Toolkit
|
||
|
Room room = (Room) rooms.elementAt(15);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("You can take parts in and out of the Toolkit with the cursor.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("To take a part out, move on top of it and press the SPACEBAR. To put it back, drop it anywhere in the Toolkit.",
|
||
|
2*28, 5*32, 500);
|
||
|
room.AddTextBox("Open Toolkit here.",
|
||
|
3*28, 9*32, 100);
|
||
|
room.AddArrow(7*28, 10*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 16, Rotating Objects
|
||
|
Room room = (Room) rooms.elementAt(16);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("You can rotate parts left and right by holding a part and pressing the [ and ] keys.",
|
||
|
2*28, 2*32, 450);
|
||
|
room.AddTextBox("There is no limit to the number of parts you can take out of the Toolkit.",
|
||
|
2*28, 5*32, 450);
|
||
|
room.AddTextBox("Open Toolkit here.",
|
||
|
3*28, 9*32, 100);
|
||
|
room.AddArrow(7*28, 10*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 17, Hot Cursor
|
||
|
Room room = (Room) rooms.elementAt(17);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("You can make the cursor HOT with elctricity. Press H.",
|
||
|
6*28, 2*32, 300);
|
||
|
room.AddTextBox("Pass the hot cursor over the antenna INPUT to turn the antenna on.",
|
||
|
6*28, 5*32, 300);
|
||
|
room.AddTextBox("Press H again to make the cursor cold.",
|
||
|
6*28, 8*32, 300);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
items.addElement(new Antenna(2*28, 2*32, room, Color.white));
|
||
|
}
|
||
|
{ // Room 18 Crossroads
|
||
|
Room room = (Room) rooms.elementAt(18);
|
||
|
int[][] table = {
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,4,4,4,4,4,4,4,0,0,0,0,4,4,4,4,4,4,4,4}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("{BIG} CROSSROADS",
|
||
|
3*28, 4*32, 500);
|
||
|
room.AddTextBox("(Turn the Remote Control on.)",
|
||
|
4*28, 5*32, 250);
|
||
|
room.AddTextBox("NODES",
|
||
|
2*28, 32+16, 300);
|
||
|
room.AddTextBox("FLIPFLOPS",
|
||
|
15*28, 32+16, 300);
|
||
|
room.AddTextBox("LOGIC GATES",
|
||
|
16*28, 6*32, 100);
|
||
|
room.AddTextBox("When you have learned all about the Toolkit, go this way.",
|
||
|
4*28, 9*32, 300);
|
||
|
room.AddArrow(3*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
room.AddArrow(17*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
room.AddArrow(559, 6*32, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(10*28, 383, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 19, Paths to Nodes & FlipFlops
|
||
|
Room room = (Room) rooms.elementAt(19);
|
||
|
int[][] table = {
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4},
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddArrow(3*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
room.AddArrow(0, 6*32+16, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 20, Nodes Intro
|
||
|
Room room = (Room) rooms.elementAt(20);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Nodes make electricity branch to two or three places.",
|
||
|
2*28, 2*32, 350);
|
||
|
room.AddTextBox("Take a node from the Toolkit and carry it to the next room.",
|
||
|
2*28, 9*32, 500);
|
||
|
room.AddArrow(0, 6*32+16, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
items.addElement(new Node(13*28, 32+16, room, Node.TYPE_STRAIGHT));
|
||
|
items.addElement(new Node(15*28, 32+16, room, Node.TYPE_RIGHT));
|
||
|
items.addElement(new Node(17*28, 32+16, room, Node.TYPE_THREE));
|
||
|
}
|
||
|
{ // Room 21, Nodes Workshop
|
||
|
Room room = (Room) rooms.elementAt(21);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Wire the INPUT (circle) of the node to the OUTPUT of the CONTACT sensor. Wire the node outputs to the thrusters.",
|
||
|
2*28, 2*32, 275);
|
||
|
room.AddTextBox("Drop the blue key so that it touches the sensor. Electricity flows to both thrusters.",
|
||
|
2*28, 9*32, 500);
|
||
|
items.addElement(new Key(11*28, 2*32, room, Color.white));
|
||
|
items.addElement(new ContactSensor(11*28, 4*32, room, new Key(0,0,null, Color.white)));
|
||
|
items.addElement(new Thruster(15*28, 32+16, room, Port.ROT_UP, Color.white));
|
||
|
items.addElement(new Thruster(16*28, 3*32, room, Port.ROT_RIGHT, Color.white));
|
||
|
}
|
||
|
{ // Room 22, Flipflop intro
|
||
|
Room room = (Room) rooms.elementAt(22);
|
||
|
int[][] table = {
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("A flipflop is like a light switch. It 'flips' electricity from one output to the other.",
|
||
|
5*28, 2*32, 300);
|
||
|
room.AddTextBox("Take a flipflop from the Toolkit. Put the hot cursor on one input at a time to make the electricity 'flip' or 'flop'.",
|
||
|
5*28, 6*32, 300);
|
||
|
items.addElement(new FlipFlop(17*28+7, 32+16, room));
|
||
|
room.AddArrow(3*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 23, Flipflop workshop
|
||
|
Room room = (Room) rooms.elementAt(23);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Go inside the robot and wire the orange OUTPUT of the flipflop to the thruster on the right. Sit on the eye to see what you did.",
|
||
|
5*28, 8*32, 420);
|
||
|
BlueRobot robot = new BlueRobot(9*28,4*32,room);
|
||
|
items.addElement(robot);
|
||
|
FlipFlop ff = new FlipFlop(10*28, 5*32, robot.InternalRoom);
|
||
|
items.addElement(ff);
|
||
|
Wire wire = new Wire(ff.ports[0], robot.devices[7].ports[0]);
|
||
|
wire = new Wire(ff.ports[2], robot.devices[3].ports[0]);
|
||
|
wire = new Wire(robot.devices[5].ports[0], ff.ports[1]);
|
||
|
robot.thrusterPower=true;
|
||
|
}
|
||
|
{ // Room 24, Crossroads II
|
||
|
Room room = (Room) rooms.elementAt(24);
|
||
|
int[][] table = {
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Crossroads",
|
||
|
2*28, 6*32+8, 500);
|
||
|
room.AddTextBox("NOT-gate",
|
||
|
2*28, 32+16, 500);
|
||
|
room.AddTextBox("AND-gate",
|
||
|
15*28, 2*32+16, 500);
|
||
|
room.AddTextBox("XOR-gate",
|
||
|
15*28, 10*32, 500);
|
||
|
room.AddTextBox("OR-gate",
|
||
|
2*28, 10*32+16, 500);
|
||
|
room.AddArrow(3*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
room.AddArrow(559, 2*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
room.AddArrow(3*28, 383, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
room.AddArrow(0, 6*32, Arrow.DIR_LEFT, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 25, NOT gate intro
|
||
|
Room room = (Room) rooms.elementAt(25);
|
||
|
int[][] table = {
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("A NOT-gate inverts electricity flow. It turns on when its INPUT is NOT on.",
|
||
|
5*28, 2*32, 300);
|
||
|
room.AddTextBox("Take a NOT-gate from the Toolkit and use the hot cursor to see how it works.",
|
||
|
5*28, 6*32, 400);
|
||
|
items.addElement(new NOTGate(17*28+10, 32+12, room));
|
||
|
room.AddArrow(3*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 26, NOT gate workshop
|
||
|
Room room = (Room) rooms.elementAt(26);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Wire the NOT-gate output to the Antenna INPUT.",
|
||
|
5*28, 2*32, 400);
|
||
|
room.AddTextBox("The antenna beeps when the crystal is NOT touching the CONTACT sensor.",
|
||
|
5*28, 8*32, 400);
|
||
|
items.addElement(new Crystal(3*28, 7*32, room, 100000));
|
||
|
ContactSensor sensor = new ContactSensor(2*28, 6*32, room, new Crystal(0,0,null,0));
|
||
|
items.addElement(sensor);
|
||
|
NOTGate ng = new NOTGate(4*28, 4*32, room);
|
||
|
items.addElement(ng);
|
||
|
items.addElement(new Antenna(2*28, 2*32, room, Color.white));
|
||
|
Wire wire = new Wire(sensor.ports[0], ng.ports[0]);
|
||
|
}
|
||
|
{ // Room 27, OR gate intro
|
||
|
Room room = (Room) rooms.elementAt(27);
|
||
|
int[][] table = {
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("An OR-gate turns on when one OR the other INPUT is on, or both.",
|
||
|
5*28, 2*32, 300);
|
||
|
room.AddTextBox("Take an OR-gate from the Toolkit and use the hot cursor to see how it works.",
|
||
|
2*28, 8*32, 400);
|
||
|
items.addElement(new ORGate(17*28+10, 32+12, room));
|
||
|
room.AddArrow(17*28, 0, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 28, OR workshop
|
||
|
Room room = (Room) rooms.elementAt(28);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Wire the OR-gate output to the Antenna INPUT.",
|
||
|
5*28, 2*32, 400);
|
||
|
room.AddTextBox("The antenna beeps when the key is above OR left of the sensor.",
|
||
|
5*28, 10*32, 400);
|
||
|
items.addElement(new Key(3*28, 7*32, room, Color.blue));
|
||
|
DirectionalSensor sensor = new DirectionalSensor(8*28, 6*32, room,
|
||
|
new Key(0,0,null,Color.white));
|
||
|
items.addElement(sensor);
|
||
|
ORGate og = new ORGate(4*28, 4*32, room);
|
||
|
items.addElement(og);
|
||
|
items.addElement(new Antenna(2*28, 2*32, room, Color.white));
|
||
|
Wire wire = new Wire(sensor.ports[0], og.ports[1]);
|
||
|
wire = new Wire(sensor.ports[3], og.ports[0]);
|
||
|
}
|
||
|
{ // Room 29, Paths to AND & XOR
|
||
|
Room room = (Room) rooms.elementAt(29);
|
||
|
int[][] table = {
|
||
|
{4,4,4,4,4,4,4,0,0,0,0,4,4,4,4,4,4,4,4,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4},
|
||
|
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4},
|
||
|
{4,4,4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddArrow(9*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
room.AddArrow(5*28, 0, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 30, AND gate intro
|
||
|
Room room = (Room) rooms.elementAt(30);
|
||
|
int[][] table = {
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,0,0,0,0,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("An AND-gate turns on when its left AND right INPUTS are on.",
|
||
|
5*28, 2*32, 300);
|
||
|
room.AddTextBox("Take a AND-gate from the Toolkit and test it with the hot cursor.",
|
||
|
5*28, 6*32, 400);
|
||
|
items.addElement(new ANDGate(17*28+10, 32+12, room));
|
||
|
room.AddArrow(3*28, 0, Arrow.DIR_UP, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 31, AND gate workshop
|
||
|
Room room = (Room) rooms.elementAt(31);
|
||
|
int[][] table3 = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table3;
|
||
|
room.AddTextBox("Wire the AND-gate output to the Antenna INPUT.",
|
||
|
5*28, 2*32, 400);
|
||
|
room.AddTextBox("The antenna beeps when the key is left AND up from this DIRECTIONAL sensor.",
|
||
|
5*28, 9*32, 400);
|
||
|
items.addElement(new Key(3*28, 7*32, room, Color.blue));
|
||
|
DirectionalSensor sensor = new DirectionalSensor(5*28, 6*32, room,
|
||
|
new Key(0,0,null,Color.white));
|
||
|
items.addElement(sensor);
|
||
|
ANDGate ag = new ANDGate(4*28, 4*32, room);
|
||
|
items.addElement(ag);
|
||
|
items.addElement(new Antenna(2*28, 2*32, room, Color.white));
|
||
|
Wire wire = new Wire(sensor.ports[0], ag.ports[1]);
|
||
|
wire = new Wire(sensor.ports[3], ag.ports[0]);
|
||
|
}
|
||
|
{ // Room 32, XOR gate intro
|
||
|
Room room = (Room) rooms.elementAt(32);
|
||
|
int[][] table = {
|
||
|
{2,2,2,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("An EXCLUSIVE-OR- gate (XOR-gate) turns on when one OR the other INPUT is on, NOT both.",
|
||
|
7*28, 2*32, 250);
|
||
|
room.AddTextBox("Take an XOR-gate from the Toolkit and test it with the hot cursor.",
|
||
|
2*28, 9*32, 400);
|
||
|
items.addElement(new XORGate(17*28+10, 32+12, room));
|
||
|
room.AddArrow(17*28, 0, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 33, XOR workshop
|
||
|
Room room = (Room) rooms.elementAt(33);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Wire the XOR-gate output to the Antenna INPUT.",
|
||
|
5*28, 2*32, 400);
|
||
|
room.AddTextBox("The antenna beeps when either the key or the crystal is in the room, but not both.",
|
||
|
5*28, 9*32, 400);
|
||
|
items.addElement(new Key(2*28, 9*32, room, Color.blue));
|
||
|
items.addElement(new Crystal(2*28, 7*32, room, 100000));
|
||
|
RoomSensor sensor1 = new RoomSensor(8*28, 6*32, room, new Key(0,0,null,Color.white));
|
||
|
RoomSensor sensor2 = new RoomSensor(8*28, 7*32, room, new Crystal(0,0,null,0));
|
||
|
sensor1.rotate(1); sensor1.rotate(1);
|
||
|
sensor2.rotate(1); sensor2.rotate(1);
|
||
|
items.addElement(sensor1);
|
||
|
items.addElement(sensor2);
|
||
|
XORGate xg = new XORGate(4*28, 4*32, room);
|
||
|
items.addElement(xg);
|
||
|
items.addElement(new Antenna(2*28, 2*32, room, Color.white));
|
||
|
Wire wire = new Wire(sensor1.ports[0], xg.ports[1]);
|
||
|
wire = new Wire(sensor2.ports[0], xg.ports[0]);
|
||
|
}
|
||
|
{ // Room 34, Circuit Ideas I
|
||
|
Room room = (Room) rooms.elementAt(34);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,0,0,0,0,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,0,0,0,0,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Try these robot circuits in the robot below.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("LEFT WALL CRAWLER",
|
||
|
3*28, 4*32, 500);
|
||
|
room.AddTextBox("Rewire the NOT gate to the thruster on the right.",
|
||
|
4*28, 4*32+16, 400);
|
||
|
room.AddTextBox("PING-PONG",
|
||
|
3*28, 7*32, 500);
|
||
|
room.AddTextBox("Unwire the NOT-gate. Use a second flipflop wired the same way as the robot in the flipflop example above.",
|
||
|
4*28, 7*32+16, 400);
|
||
|
room.AddTextBox("MORE CIRCUIT IDEAS",
|
||
|
0, 9*32, 100);
|
||
|
room.AddTextBox("ROBOT",
|
||
|
9*28, 11*32, 400);
|
||
|
room.AddArrow(10*28, 383, Arrow.DIR_DOWN, 28, Color.white);
|
||
|
}
|
||
|
{ // Room 35, Circuit Ideas II
|
||
|
Room room = (Room) rooms.elementAt(35);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("KEY-PHOBE",
|
||
|
2*28, 2*32, 450);
|
||
|
room.AddTextBox("Wire a key DIRECTIONAL sensor's outputs to the thrusters they point toward.",
|
||
|
3*28, 2*32+16, 450);
|
||
|
room.AddTextBox("NON-KEY-GRABBER",
|
||
|
2*28, 5*32, 450);
|
||
|
room.AddTextBox("Wire a key CONTACT sensor to a NOT-gate. Wire the NOT-gate to the grabber input.",
|
||
|
3*28, 5*32+16, 450);
|
||
|
room.AddTextBox("CRYSTAL-SIGNALER",
|
||
|
2*28, 8*32, 450);
|
||
|
room.AddTextBox("Wire the crystal IN-SAME-ROOM sensor to the antenna.",
|
||
|
3*28, 8*32+16, 450);
|
||
|
}
|
||
|
{ // Room 36, Robot Play area 1
|
||
|
Room room = (Room) rooms.elementAt(36);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,0,0,0,0,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,0,0,0,0,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
WhiteRobot robot = new WhiteRobot(0,6*32,room);
|
||
|
items.addElement(robot);
|
||
|
NOTGate ng = new NOTGate(3*28,5*32,robot.InternalRoom);
|
||
|
items.addElement(ng);
|
||
|
ng.rotate(1); ng.rotate(1);
|
||
|
FlipFlop ff = new FlipFlop(10*28, 4*32, robot.InternalRoom);
|
||
|
items.addElement(ff);
|
||
|
Wire wire = new Wire(robot.devices[3].ports[0], ng.ports[1]);
|
||
|
wire = new Wire(robot.devices[6].ports[0], ff.ports[0]);
|
||
|
wire = new Wire(ff.ports[1], robot.devices[4].ports[0]);
|
||
|
wire = new Wire(ff.ports[2], robot.devices[2].ports[0]);
|
||
|
wire = new Wire(ff.ports[3], robot.devices[0].ports[0]);
|
||
|
ContactSensor sensor = new ContactSensor(15*28, 6*32, robot.InternalRoom,
|
||
|
new Button(0,0,null,Color.white));
|
||
|
items.addElement(sensor);
|
||
|
robot.thrusterPower=true;
|
||
|
items.addElement(new Key(2*28, 9*32, room, Color.blue));
|
||
|
items.addElement(new Crystal(4*28, 9*32, room, 100000));
|
||
|
}
|
||
|
{ // Room 37, Robot Play area 2
|
||
|
Room room = (Room) rooms.elementAt(37);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0},
|
||
|
{3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0},
|
||
|
{3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0},
|
||
|
{3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0},
|
||
|
{3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
items.addElement(new Button(16*28, 32+16, room, new Color(255,128,0)));
|
||
|
}
|
||
|
{ // Room 38, Robot Play area 3
|
||
|
Room room = (Room) rooms.elementAt(38);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,3,0,0,0,3,3,3,3,3,3,3,0,0,0,3},
|
||
|
{3,0,0,0,0,3,0,0,0,3,0,0,0,0,0,3,0,0,0,3},
|
||
|
{3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,3},
|
||
|
{3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,3},
|
||
|
{3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
items.addElement(new Button(12*28, 5*32, room, new Color(0,0,255)));
|
||
|
}
|
||
|
{ // Room 39, End
|
||
|
Room room = (Room) rooms.elementAt(39);
|
||
|
int[][] table = {
|
||
|
{2,2,2,2,2,2,2,2,0,0,0,0,2,2,2,2,2,2,2,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,2},
|
||
|
{2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Now you know how to use the Solderpen, Remote Control, and Toolkit.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("You also know how nodes, flipflops, and logic gates work.",
|
||
|
2*28, 3*32+16, 500);
|
||
|
room.AddTextBox("You can use these to design and build robots in ROBOTROPOLIS and the INNOVATION LAB.",
|
||
|
2*28, 6*32, 500);
|
||
|
room.AddTextBox("Go to CHIP DESIGN.",
|
||
|
6*28, 9*32, 500);
|
||
|
room.AddTextBox("Return to MAIN MENU.",
|
||
|
6*28, 11*32, 500);
|
||
|
}
|
||
|
{ // Room 40, Wire Flipping
|
||
|
Room room = (Room) rooms.elementAt(40);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("Wires are normally drawn as a horizontal line and a vertical line attached to the 1st and 2nd ports. But these can be 'flipped' without having to remove the wire.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("Become the Soldering Pen and move the tip over any wired port until the tip turns green and then press F.",
|
||
|
2*28, 6*32, 500);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
NOTGate ng1 = new NOTGate(6*28, 10*32, room);
|
||
|
items.addElement(ng1);
|
||
|
ng1.rotate(1);
|
||
|
NOTGate ng2 = new NOTGate(12*28, 8*32, room);
|
||
|
items.addElement(ng2);
|
||
|
Wire wire = new Wire(ng1.ports[1], ng2.ports[0]);
|
||
|
}
|
||
|
{ // Room 41, Gate Flipping
|
||
|
Room room = (Room) rooms.elementAt(41);
|
||
|
int[][] table = {
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||
|
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}
|
||
|
};
|
||
|
room.RoomArray = table;
|
||
|
room.AddTextBox("AND, OR, XOR, and FlipFlops can also be flipped so their inputs (and outputs) can switch connections without having to rewire them.",
|
||
|
2*28, 2*32, 500);
|
||
|
room.AddTextBox("Become the cursor and pick up a gate, and then press F.",
|
||
|
2*28, 5*32, 500);
|
||
|
room.AddArrow(559, 9*32+16, Arrow.DIR_RIGHT, 28, Color.white);
|
||
|
NOTGate ng1 = new NOTGate(4*28, 10*32, room);
|
||
|
ng1.rotate(1);
|
||
|
items.addElement(ng1);
|
||
|
NOTGate ng2 = new NOTGate(8*28, 10*32, room);
|
||
|
ng2.rotate(-1);
|
||
|
items.addElement(ng2);
|
||
|
NOTGate ng3 = new NOTGate(10*28, 10*32, room);
|
||
|
ng3.rotate(1);
|
||
|
items.addElement(ng3);
|
||
|
NOTGate ng4 = new NOTGate(14*28, 10*32, room);
|
||
|
ng4.rotate(-1);
|
||
|
items.addElement(ng4);
|
||
|
ANDGate ag = new ANDGate(6*28,8*32,room);
|
||
|
ag.rotate(1);
|
||
|
items.addElement(ag);
|
||
|
XORGate xg = new XORGate(12*28,8*32,room);
|
||
|
xg.rotate(-1);
|
||
|
items.addElement(xg);
|
||
|
FlipFlop ff = new FlipFlop(9*28,7*32,room);
|
||
|
items.addElement(ff);
|
||
|
ORGate og = new ORGate(12*28,6*32,room);
|
||
|
og.rotate(1);
|
||
|
items.addElement(og);
|
||
|
new Wire(ag.ports[0], ng1.ports[1]);
|
||
|
new Wire(ng2.ports[1], ag.ports[1]);
|
||
|
new Wire(ng3.ports[1], xg.ports[0]);
|
||
|
new Wire(xg.ports[1], ng4.ports[1]);
|
||
|
new Wire(ag.ports[2], ff.ports[0]);
|
||
|
new Wire(xg.ports[2], ff.ports[1]);
|
||
|
new Wire(og.ports[0], ff.ports[2]);
|
||
|
new Wire(og.ports[1], ff.ports[3]);
|
||
|
}
|
||
|
|
||
|
|
||
|
int[] list1={1,2,3,4,5,6};
|
||
|
LinkRoomsHorizontally(list1);
|
||
|
int[] list2={11,10,9,8,7};
|
||
|
LinkRoomsHorizontally(list2);
|
||
|
int[] list3={12,13,14,15,16,40,41,17,18,24,29};
|
||
|
LinkRoomsHorizontally(list3);
|
||
|
int[] list4={23,22,19,18,34,36,39,1};
|
||
|
LinkRoomsVertically(list4);
|
||
|
int[] list5={26,25,24,27,28};
|
||
|
LinkRoomsVertically(list5);
|
||
|
int[] list6={31,30,29,32,33};
|
||
|
LinkRoomsVertically(list6);
|
||
|
LinkRoomsLeftRight(21,20);
|
||
|
LinkRoomsLeftRight(20,19);
|
||
|
LinkRoomsLeftRight(35,34);
|
||
|
LinkRoomsLeftRight(37,36);
|
||
|
LinkRoomsUpDown(4,10);
|
||
|
LinkRoomsUpDown(6,7);
|
||
|
LinkRoomsUpDown(11,12);
|
||
|
LinkRoomsUpDown(37,38);
|
||
|
|
||
|
gameCursor = new LabCursor(16*28+14,5*32+16,(Room) rooms.elementAt(1));
|
||
|
helpCam = new HelpCam( (Room) rooms.elementAt(0));
|
||
|
solderingPen = new SolderingPen();
|
||
|
remote = new Remote();
|
||
|
items.addElement(gameCursor);
|
||
|
items.addElement(helpCam);
|
||
|
items.addElement(solderingPen);
|
||
|
items.addElement(remote);
|
||
|
player = gameCursor;
|
||
|
currentViewer = player;
|
||
|
}
|
||
|
|
||
|
}
|