Browse Source

Updated folder hierarchy and save and restore

tags/2.7
Chris Cromer 4 years ago
parent
commit
822099c90c
25 changed files with 19 additions and 109 deletions
  1. +10
    -0
      INSTALL
  2. +3
    -0
      README.md
  3. +0
    -0
      chips/4NodeL2R.chip
  4. +0
    -0
      chips/4NodeR2L.chip
  5. +0
    -0
      chips/4ORL2R.chip
  6. +0
    -0
      chips/4ORR2L.chip
  7. +0
    -0
      chips/6BitCounter.chip
  8. +0
    -0
      chips/Bus.chip
  9. +0
    -0
      chips/Clock.chip
  10. BIN
      chips/CountToN.chip
  11. +0
    -0
      chips/Delay.chip
  12. +0
    -0
      chips/FullAdder.chip
  13. +0
    -0
      chips/Monomer.chip
  14. +0
    -0
      chips/OneShot.chip
  15. +0
    -0
      chips/RSflipflop.chip
  16. +0
    -0
      chips/Token.chip
  17. BIN
      chips/WallHugger.chip
  18. BIN
      chips/gates.chip
  19. +0
    -0
      chips/old_WallHugger.chip
  20. BIN
      chips/oscillator.chip
  21. +0
    -0
      chips/quarter.chip
  22. +2
    -1
      src/com/droidquest/DQ.java
  23. +2
    -2
      src/com/droidquest/avatars/Player.java
  24. +1
    -105
      src/com/droidquest/devices/SmallChip.java
  25. +1
    -1
      src/com/droidquest/levels/MainMenu.java

+ 10
- 0
INSTALL View File

@@ -0,0 +1,10 @@
To compile the game you must run:
$ make

To install the game use the command:
# make install

To uninstall:
# make uninstall

The compilation requires gcc and maven to be installed on the system.

+ 3
- 0
README.md View File

@@ -6,6 +6,9 @@ A Java recreation of the classic game Robot Odyssey I

Copyright (c) 2000 Thomas Foote

Optimization to compile, install, and run under linux:
Copyright (c) 2015 Chris Cromer

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including

src/main/resources/chips/4NodeL2R.chip → chips/4NodeL2R.chip View File


src/main/resources/chips/4NodeR2L.chip → chips/4NodeR2L.chip View File


src/main/resources/chips/4ORL2R.chip → chips/4ORL2R.chip View File


src/main/resources/chips/4ORR2L.chip → chips/4ORR2L.chip View File


src/main/resources/chips/6BitCounter.chip → chips/6BitCounter.chip View File


src/main/resources/chips/Bus.chip → chips/Bus.chip View File


src/main/resources/chips/Clock.chip → chips/Clock.chip View File


BIN
chips/CountToN.chip View File


src/main/resources/chips/Delay.chip → chips/Delay.chip View File


src/main/resources/chips/FullAdder.chip → chips/FullAdder.chip View File


src/main/resources/chips/Monomer.chip → chips/Monomer.chip View File


src/main/resources/chips/OneShot.chip → chips/OneShot.chip View File


src/main/resources/chips/RSflipflop.chip → chips/RSflipflop.chip View File


src/main/resources/chips/Token.chip → chips/Token.chip View File


BIN
chips/WallHugger.chip View File


BIN
chips/gates.chip View File


src/main/resources/chips/old_WallHugger.chip → chips/old_WallHugger.chip View File


BIN
chips/oscillator.chip View File


src/main/resources/chips/quarter.chip → chips/quarter.chip View File


+ 2
- 1
src/com/droidquest/DQ.java View File

@@ -11,6 +11,8 @@ import java.awt.*;
import java.awt.event.*;
import java.util.Set;

import java.io.*;

public class DQ extends JFrame implements ActionListener {
private RoomDisplay myRoom;

@@ -276,7 +278,6 @@ public class DQ extends JFrame implements ActionListener {
}
}


public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Save Level")) {
FileDialog fd = new FileDialog(this, "Save Level", FileDialog.SAVE);

+ 2
- 2
src/com/droidquest/avatars/Player.java View File

@@ -136,8 +136,8 @@ public class Player extends Item implements Avatar {
+ fd.getFile());
if (fd.getFile() != null) {
((SmallChip) carrying).Empty();
//((SmallChip) carrying).LoadChip(fd.getDirectory() + fd.getFile());
((SmallChip) carrying).LoadChip(fd.getFile(), false);
((SmallChip) carrying).LoadChip(fd.getDirectory() + fd.getFile(), false);
//((SmallChip) carrying).LoadChip(fd.getFile(), false);
}
return true;
}

+ 1
- 105
src/com/droidquest/devices/SmallChip.java View File

@@ -239,111 +239,7 @@ public class SmallChip extends GenericChip {
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 {
if (gameChip) {
filename = "/usr/share/DroidQuest/chips/" + filename;
}


+ 1
- 1
src/com/droidquest/levels/MainMenu.java View File

@@ -267,7 +267,7 @@ public class MainMenu extends Level {
player = gameCursor;
currentViewer = player;

File f = new File(System.getProperty("user.home") + "/.DroidQuest/" + "ROlevels/");
File f = new File(System.getProperty("user.home") + "/.DroidQuest/ROlevels/");
if (!f.exists()) {
f.mkdir();
}

Loading…
Cancel
Save