Initial commit
28
Makefile
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
CC = gcc
|
||||||
|
MV = mvn
|
||||||
|
|
||||||
|
CFLAGS=-Wall -Werror -ggdb
|
||||||
|
|
||||||
|
BIN=DroidQuest
|
||||||
|
JAR=dq-2.7.jar
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(CC) $(CFLAGS) dq.c -o dq.o
|
||||||
|
$(CC) $(CFLAGS) dq.c -o $(BIN)
|
||||||
|
$(MV) install
|
||||||
|
|
||||||
|
install:
|
||||||
|
mkdir -vp /usr/share/DroidQuest/chips
|
||||||
|
cp -v src/main/resources/chips/* /usr/share/DroidQuest/chips/
|
||||||
|
cp -v target/$(JAR) /usr/share/DroidQuest/$(JAR)
|
||||||
|
cp -v $(BIN) /usr/bin/$(BIN)
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm -v /usr/share/DroidQuest/chips/*
|
||||||
|
rm -v /usr/share/DroidQuest/$(JAR)
|
||||||
|
rmdir -v /usr/share/DroidQuest/chips
|
||||||
|
rmdir -v /usr/share/DroidQuest
|
||||||
|
rm -v /usr/bin/$(BIN)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -vR -f *.o *.~ target/classes/ target/maven-archiver target/maven-status
|
6
dq.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
system("java -jar /usr/share/DroidQuest/dq-2.7.jar");
|
||||||
|
return 0;
|
||||||
|
}
|
19
pom.xml
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>com.droidquest</groupId>
|
<groupId>com.droidquest</groupId>
|
||||||
<artifactId>dq</artifactId>
|
<artifactId>dq</artifactId>
|
||||||
<version>1.1-SNAPSHOT</version>
|
<version>2.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>DroidQuest</name>
|
<name>DroidQuest</name>
|
||||||
@ -16,6 +16,23 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src</sourceDirectory>
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<!-- Build an executable JAR -->
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
|
<mainClass>com.droidquest.DQ</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -39,7 +39,7 @@ public class DQ extends JFrame implements ActionListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setIconImage(new ImageIcon("images/helper0.gif").getImage());
|
setIconImage(new ImageIcon(getClass().getResource("/images/helper0.gif")).getImage());
|
||||||
|
|
||||||
Container contentPane = getContentPane();
|
Container contentPane = getContentPane();
|
||||||
myRoom = new RoomDisplay(this);
|
myRoom = new RoomDisplay(this);
|
||||||
@ -280,7 +280,7 @@ public class DQ extends JFrame implements ActionListener {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (e.getActionCommand().equals("Save Level")) {
|
if (e.getActionCommand().equals("Save Level")) {
|
||||||
FileDialog fd = new FileDialog(this, "Save Level", FileDialog.SAVE);
|
FileDialog fd = new FileDialog(this, "Save Level", FileDialog.SAVE);
|
||||||
fd.setDirectory("ROlevels");
|
fd.setDirectory(System.getProperty("user.home") + "/.DroidQuest/" + "ROlevels");
|
||||||
fd.show();
|
fd.show();
|
||||||
System.out.println("Dialog returned with "
|
System.out.println("Dialog returned with "
|
||||||
+ fd.getDirectory()
|
+ fd.getDirectory()
|
||||||
|
@ -445,7 +445,7 @@ public class RoomDisplay extends JPanel {
|
|||||||
public void SaveLevel(String filename) {
|
public void SaveLevel(String filename) {
|
||||||
System.out.println("Saving level " + filename);
|
System.out.println("Saving level " + filename);
|
||||||
try {
|
try {
|
||||||
FileOutputStream out = new FileOutputStream(filename);
|
FileOutputStream out = new FileOutputStream(System.getProperty("user.home") + "/.DroidQuest/" + "ROlevels/" + filename);
|
||||||
ObjectOutputStream s = new ObjectOutputStream(out);
|
ObjectOutputStream s = new ObjectOutputStream(out);
|
||||||
level.writeObject(s);
|
level.writeObject(s);
|
||||||
s.flush();
|
s.flush();
|
||||||
@ -471,7 +471,7 @@ public class RoomDisplay extends JPanel {
|
|||||||
|
|
||||||
// Add flags for loading Object inventories or running Init()
|
// Add flags for loading Object inventories or running Init()
|
||||||
try {
|
try {
|
||||||
FileInputStream in = new FileInputStream(filename);
|
FileInputStream in = new FileInputStream(System.getProperty("user.home") + "/.DroidQuest/" + "ROlevels/" + filename);
|
||||||
ObjectInputStream s = new ObjectInputStream(in);
|
ObjectInputStream s = new ObjectInputStream(in);
|
||||||
level.readObject(s);
|
level.readObject(s);
|
||||||
s.close();
|
s.close();
|
||||||
|
@ -5,19 +5,23 @@ import java.applet.AudioClip;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
|
||||||
public class SoundClip {
|
public class SoundClip {
|
||||||
public AudioClip audioClip;
|
public AudioClip audioClip;
|
||||||
private String filename;
|
private String filename;
|
||||||
|
|
||||||
public SoundClip(String f) {
|
public SoundClip(String f) {
|
||||||
filename = f;
|
filename = f;
|
||||||
|
URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation();
|
||||||
try {
|
try {
|
||||||
URL baseURL = new URL("file:" + System.getProperty("user.dir") + "/sounds/");
|
String jarPath = URLDecoder.decode(url.getFile(), "UTF-8");
|
||||||
|
URL baseURL = new URL("jar:file:" + jarPath + "!/sounds/");
|
||||||
URL soundURL;
|
URL soundURL;
|
||||||
soundURL = new URL(baseURL, filename);
|
soundURL = new URL(baseURL, filename);
|
||||||
audioClip = Applet.newAudioClip(soundURL);
|
audioClip = Applet.newAudioClip(soundURL);
|
||||||
}
|
}
|
||||||
catch (MalformedURLException e) {
|
catch(Exception e) {
|
||||||
System.err.println(e.getMessage());
|
System.err.println(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,8 @@ public class Player extends Item implements Avatar {
|
|||||||
+ fd.getFile());
|
+ fd.getFile());
|
||||||
if (fd.getFile() != null) {
|
if (fd.getFile() != null) {
|
||||||
((SmallChip) carrying).Empty();
|
((SmallChip) carrying).Empty();
|
||||||
((SmallChip) carrying).LoadChip(fd.getDirectory() + fd.getFile());
|
//((SmallChip) carrying).LoadChip(fd.getDirectory() + fd.getFile());
|
||||||
|
((SmallChip) carrying).LoadChip(fd.getFile(), false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ public class Graphix implements Serializable {
|
|||||||
int numfiles = filenames.length;
|
int numfiles = filenames.length;
|
||||||
icons = new ImageIcon[numfiles];
|
icons = new ImageIcon[numfiles];
|
||||||
for (int a = 0; a < numfiles; a++) {
|
for (int a = 0; a < numfiles; a++) {
|
||||||
icons[a] = new ImageIcon("images/" + filenames[a]);
|
icons[a] = new ImageIcon(getClass().getResource("/images/" + filenames[a]));
|
||||||
}
|
}
|
||||||
icon = icons[0];
|
icon = icons[0];
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,12 @@ import com.droidquest.materials.SmallChipBurner;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.awt.event.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
|
|
||||||
public class SmallChip extends GenericChip {
|
public class SmallChip extends GenericChip {
|
||||||
public int speed;
|
public int speed;
|
||||||
|
|
||||||
@ -231,8 +234,119 @@ public class SmallChip extends GenericChip {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadChip(String filename) {
|
public void LoadChip(String filename, boolean gameChip) {
|
||||||
try {
|
try {
|
||||||
|
File file;
|
||||||
|
InputStream link;
|
||||||
|
|
||||||
|
if (!gameChip) {
|
||||||
|
filename = System.getProperty("user.home") + "/.DroidQuest/chips/" + filename;
|
||||||
|
|
||||||
|
/* Create default chips for user */
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/");
|
||||||
|
if (!file.exists()) {
|
||||||
|
file.mkdirs();
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/CountToN.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/CountToN.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/gates.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/gates.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/oscillator.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/oscillator.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/WallHugger.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/WallHugger.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4NodeL2R.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/4NodeL2R.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4NodeR2L.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/4NodeR2L.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4ORL2R.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/4ORL2R.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4ORR2L.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/4ORR2L.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/6BitCounter.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/6BitCounter.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Bus.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/Bus.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Clock.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/Clock.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Delay.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/Delay.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/FullAdder.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/FullAdder.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Monomer.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/Monomer.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/old_WallHugger.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/old_WallHugger.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/OneShot.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/OneShot.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/quarter.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/quarter.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/RSflipflop.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/RSflipflop.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Token.chip");
|
||||||
|
if (!file.exists()) {
|
||||||
|
link = getClass().getResourceAsStream("/chips/Token.chip");
|
||||||
|
Files.copy(link, file.getAbsoluteFile().toPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
filename = "/usr/share/DroidQuest/chips/" + filename;
|
||||||
|
}
|
||||||
|
|
||||||
FileInputStream in = new FileInputStream(filename);
|
FileInputStream in = new FileInputStream(filename);
|
||||||
ObjectInputStream s = new ObjectInputStream(in);
|
ObjectInputStream s = new ObjectInputStream(in);
|
||||||
|
|
||||||
@ -367,4 +481,12 @@ public class SmallChip extends GenericChip {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void copyFile(InputStream in, OutputStream out) throws IOException {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int read;
|
||||||
|
while((read = in.read(buffer)) != -1){
|
||||||
|
out.write(buffer, 0, read);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.droidquest.items;
|
package com.droidquest.items;
|
||||||
|
|
||||||
import com.droidquest.Room;
|
import com.droidquest.Room;
|
||||||
|
import com.droidquest.Wire;
|
||||||
import com.droidquest.chipstuff.Port;
|
import com.droidquest.chipstuff.Port;
|
||||||
import com.droidquest.devices.Device;
|
import com.droidquest.devices.Device;
|
||||||
import com.droidquest.devices.PortDevice;
|
import com.droidquest.devices.PortDevice;
|
||||||
@ -112,8 +113,7 @@ public class AutoWire extends Item {
|
|||||||
|
|
||||||
if (animation == 1) {
|
if (animation == 1) {
|
||||||
if (portdevices[0].ports[0].myWire == null) { // Wiring
|
if (portdevices[0].ports[0].myWire == null) { // Wiring
|
||||||
portdevices[0].ports[0].type = Port.TYPE_UNDEFINED;
|
portdevices[0].ports[0].myWire = new Wire(chip.ports[0], portdevices[0].ports[0]);
|
||||||
portdevices[0].ports[0].value = false;
|
|
||||||
}
|
}
|
||||||
else { // Unwiring
|
else { // Unwiring
|
||||||
portdevices[0].ports[0].myWire.Remove();
|
portdevices[0].ports[0].myWire.Remove();
|
||||||
@ -128,8 +128,7 @@ public class AutoWire extends Item {
|
|||||||
if (animation >= 2 && animation <= 8) {
|
if (animation >= 2 && animation <= 8) {
|
||||||
if (portdevices[0].ports[0].myWire != null) { // Wiring
|
if (portdevices[0].ports[0].myWire != null) { // Wiring
|
||||||
if (portdevices[animation - 1].ports[0].myWire == null) {
|
if (portdevices[animation - 1].ports[0].myWire == null) {
|
||||||
portdevices[animation - 1].ports[0].type = Port.TYPE_UNDEFINED;
|
portdevices[animation - 1].ports[0].myWire = new Wire(chip.ports[animation - 1], portdevices[animation - 1].ports[0]);
|
||||||
portdevices[animation - 1].ports[0].value = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // Unwiring
|
else { // Unwiring
|
||||||
|
@ -22,7 +22,7 @@ public class SkyGuard extends Item {
|
|||||||
public void GenerateIcons() {
|
public void GenerateIcons() {
|
||||||
icons = new ImageIcon[5];
|
icons = new ImageIcon[5];
|
||||||
for (int a = 0; a < 5; a++) {
|
for (int a = 0; a < 5; a++) {
|
||||||
icons[a] = new ImageIcon("images/skyguard" + a + ".gif");
|
icons[a] = new ImageIcon(getClass().getResource("/images/skyguard" + a + ".gif"));
|
||||||
}
|
}
|
||||||
currentIcon = icons[0].getImage();
|
currentIcon = icons[0].getImage();
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class SkywayFlyer extends Item {
|
|||||||
public void GenerateIcons() {
|
public void GenerateIcons() {
|
||||||
icons = new ImageIcon[filenames.length];
|
icons = new ImageIcon[filenames.length];
|
||||||
for (int a = 0; a < filenames.length; a++) {
|
for (int a = 0; a < filenames.length; a++) {
|
||||||
icons[a] = new ImageIcon("images/" + filenames[a]);
|
icons[a] = new ImageIcon(getClass().getResource("/images/" + filenames[a]));
|
||||||
}
|
}
|
||||||
currentIcon = icons[0].getImage();
|
currentIcon = icons[0].getImage();
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ public class TrashCollector extends Item {
|
|||||||
|
|
||||||
public void GenerateIcons() {
|
public void GenerateIcons() {
|
||||||
icons = new ImageIcon[2];
|
icons = new ImageIcon[2];
|
||||||
icons[0] = new ImageIcon("images/trashcollector0.gif");
|
icons[0] = new ImageIcon(getClass().getResource("/images/trashcollector0.gif"));
|
||||||
icons[1] = new ImageIcon("images/trashcollector1.gif");
|
icons[1] = new ImageIcon(getClass().getResource("/images/trashcollector1.gif"));
|
||||||
currentIcon = icons[0].getImage();
|
currentIcon = icons[0].getImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,9 @@ public class Level implements ImageObserver, Serializable {
|
|||||||
BURNSOUND, ENDMUSICSOUND, STARTMUSICSOUND,
|
BURNSOUND, ENDMUSICSOUND, STARTMUSICSOUND,
|
||||||
TELEPORTSOUND, TRANSPORTSOUND
|
TELEPORTSOUND, TRANSPORTSOUND
|
||||||
};
|
};
|
||||||
public transient boolean cheatmode = true;
|
/* Cromer: Disable cheatmode */
|
||||||
|
public transient boolean cheatmode = false;
|
||||||
|
/* Cromer */
|
||||||
|
|
||||||
Level() {
|
Level() {
|
||||||
Item.level = this;
|
Item.level = this;
|
||||||
@ -892,7 +894,7 @@ public class Level implements ImageObserver, Serializable {
|
|||||||
if (item.getClass().toString().endsWith("SmallChip")) {
|
if (item.getClass().toString().endsWith("SmallChip")) {
|
||||||
SmallChip sc = (SmallChip) item;
|
SmallChip sc = (SmallChip) item;
|
||||||
String chipfilename = "tmp" + (a - orgNumItems) + ".chip";
|
String chipfilename = "tmp" + (a - orgNumItems) + ".chip";
|
||||||
sc.LoadChip(chipfilename);
|
sc.LoadChip(chipfilename, false);
|
||||||
File f = new File(chipfilename);
|
File f = new File(chipfilename);
|
||||||
f.delete();
|
f.delete();
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ public class MainMenu extends Level {
|
|||||||
player = gameCursor;
|
player = gameCursor;
|
||||||
currentViewer = player;
|
currentViewer = player;
|
||||||
|
|
||||||
File f = new File("ROlevels/");
|
File f = new File(System.getProperty("user.home") + "/.DroidQuest/" + "ROlevels/");
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
f.mkdir();
|
f.mkdir();
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ public class MainMenu extends Level {
|
|||||||
LinkRoomsUpDown(pageIndex, newPageIndex);
|
LinkRoomsUpDown(pageIndex, newPageIndex);
|
||||||
pageIndex = newPageIndex;
|
pageIndex = newPageIndex;
|
||||||
}
|
}
|
||||||
materials.addElement(new Portal("ROlevels/" + files[a], false, false));
|
materials.addElement(new Portal(files[a], false, false));
|
||||||
int matIndex = materials.size() - 1;
|
int matIndex = materials.size() - 1;
|
||||||
int y = 1 + (a % 5) * 2;
|
int y = 1 + (a % 5) * 2;
|
||||||
Room room = rooms.elementAt(pageIndex);
|
Room room = rooms.elementAt(pageIndex);
|
||||||
|
@ -181,7 +181,7 @@ class RO1 extends Level {
|
|||||||
items.addElement(ng);
|
items.addElement(ng);
|
||||||
SmallChip sc = new SmallChip(10 * 28, 6 * 32, orobot.InternalRoom, "2");
|
SmallChip sc = new SmallChip(10 * 28, 6 * 32, orobot.InternalRoom, "2");
|
||||||
items.addElement(sc);
|
items.addElement(sc);
|
||||||
sc.LoadChip("chips/WallHugger.chip");
|
sc.LoadChip("WallHugger.chip", true);
|
||||||
Wire dummy;
|
Wire dummy;
|
||||||
dummy = new Wire(rSensor.ports[0], ng.ports[0]);
|
dummy = new Wire(rSensor.ports[0], ng.ports[0]);
|
||||||
dummy = new Wire(ng.ports[1], orobot.devices[9].ports[0]); // Antenna
|
dummy = new Wire(ng.ports[1], orobot.devices[9].ports[0]); // Antenna
|
||||||
@ -846,7 +846,7 @@ class RO1 extends Level {
|
|||||||
items.addElement(gameCursor);
|
items.addElement(gameCursor);
|
||||||
|
|
||||||
SmallChip sc = new SmallChip(0, 0, null, "1");
|
SmallChip sc = new SmallChip(0, 0, null, "1");
|
||||||
sc.LoadChip("chips/CountToN.chip");
|
sc.LoadChip("CountToN.chip", true);
|
||||||
items.addElement(sc);
|
items.addElement(sc);
|
||||||
items.addElement(new RO1Init());
|
items.addElement(new RO1Init());
|
||||||
|
|
||||||
|
@ -513,7 +513,7 @@ class ROTut3 extends Level {
|
|||||||
items.addElement(new Antenna(2 * 28, 2 * 32, room, Color.white));
|
items.addElement(new Antenna(2 * 28, 2 * 32, room, Color.white));
|
||||||
SmallChip sc = new SmallChip(4 * 28, 4 * 32, room, "1");
|
SmallChip sc = new SmallChip(4 * 28, 4 * 32, room, "1");
|
||||||
items.addElement(sc);
|
items.addElement(sc);
|
||||||
sc.LoadChip("chips/oscillator.chip");
|
sc.LoadChip("oscillator.chip", true);
|
||||||
}
|
}
|
||||||
{ // Room 18, Burner Intro
|
{ // Room 18, Burner Intro
|
||||||
Room room = rooms.elementAt(18);
|
Room room = rooms.elementAt(18);
|
||||||
@ -705,7 +705,7 @@ class ROTut3 extends Level {
|
|||||||
room.AddArrow(0, 9 * 32 + 16, Arrow.DIR_LEFT, 28, Color.white);
|
room.AddArrow(0, 9 * 32 + 16, Arrow.DIR_LEFT, 28, Color.white);
|
||||||
SmallChip sc = new SmallChip(4 * 28, 5 * 32, room, "3");
|
SmallChip sc = new SmallChip(4 * 28, 5 * 32, room, "3");
|
||||||
items.addElement(sc);
|
items.addElement(sc);
|
||||||
sc.LoadChip("chips/WallHugger.chip");
|
sc.LoadChip("WallHugger.chip", true);
|
||||||
}
|
}
|
||||||
{ // Room 25, Wallhugger wiring
|
{ // Room 25, Wallhugger wiring
|
||||||
Room room = rooms.elementAt(25);
|
Room room = rooms.elementAt(25);
|
||||||
@ -862,7 +862,7 @@ class ROTut3 extends Level {
|
|||||||
room.AddArrow(2 * 28 + 14, 0, Arrow.DIR_UP, 28, Color.white);
|
room.AddArrow(2 * 28 + 14, 0, Arrow.DIR_UP, 28, Color.white);
|
||||||
SmallChip sc = new SmallChip(2 * 28, 5 * 32, room, "5");
|
SmallChip sc = new SmallChip(2 * 28, 5 * 32, room, "5");
|
||||||
items.addElement(sc);
|
items.addElement(sc);
|
||||||
sc.LoadChip("chips/gates.chip");
|
sc.LoadChip("gates.chip", true);
|
||||||
}
|
}
|
||||||
{ // Room 31, Chip Save
|
{ // Room 31, Chip Save
|
||||||
Room room = rooms.elementAt(31);
|
Room room = rooms.elementAt(31);
|
||||||
|
@ -27,7 +27,7 @@ public class PlayerBlocker extends Material {
|
|||||||
int numfiles = filenames.length;
|
int numfiles = filenames.length;
|
||||||
images = new ImageIcon[numfiles];
|
images = new ImageIcon[numfiles];
|
||||||
for (int a = 0; a < filenames.length; a++) {
|
for (int a = 0; a < filenames.length; a++) {
|
||||||
images[a] = new ImageIcon("images/" + filenames[a]);
|
images[a] = new ImageIcon(getClass().getResource("/images/" + filenames[a]));
|
||||||
}
|
}
|
||||||
icon = images[0];
|
icon = images[0];
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1013 B After Width: | Height: | Size: 1013 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 940 B After Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 999 B |
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 1000 B |
Before Width: | Height: | Size: 940 B After Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 812 B |
Before Width: | Height: | Size: 963 B After Width: | Height: | Size: 963 B |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 900 B After Width: | Height: | Size: 900 B |
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 898 B |
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 899 B |
Before Width: | Height: | Size: 900 B After Width: | Height: | Size: 900 B |
Before Width: | Height: | Size: 853 B After Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 856 B After Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 952 B |
Before Width: | Height: | Size: 967 B After Width: | Height: | Size: 967 B |
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 949 B |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 882 B |
Before Width: | Height: | Size: 853 B After Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 915 B After Width: | Height: | Size: 915 B |
Before Width: | Height: | Size: 1009 B After Width: | Height: | Size: 1009 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 424 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 965 B After Width: | Height: | Size: 965 B |
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 954 B After Width: | Height: | Size: 954 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |