diff --git a/2D Game/main.py b/2DGame/main.py similarity index 100% rename from 2D Game/main.py rename to 2DGame/main.py diff --git a/2D Game/requirements.txt b/2DGame/requirements.txt similarity index 100% rename from 2D Game/requirements.txt rename to 2DGame/requirements.txt diff --git a/README.md b/README.md index 68a812b..26f193d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Our team was inspired to develop this project by our aspiration to bridge the di # Getting Started - Please refer to our [Hardware Setup Guide](./hardware/README_HARDWARE.md) for instructions on setting up the hardware. -- Please refer to our [Software Setup Guide](./Virtual%20Environment/README_SOFTWARE.md) for instructions on setting up the software. +- Please refer to our [Software Setup Guide](./mainmenu/README_SOFTWARE.md) for instructions on setting up the software.

# Current State of the Project diff --git a/Virtual Environment/generate.py b/VirtualEnvironment/generate.py similarity index 99% rename from Virtual Environment/generate.py rename to VirtualEnvironment/generate.py index 5e0ff92..31beb82 100644 --- a/Virtual Environment/generate.py +++ b/VirtualEnvironment/generate.py @@ -1,6 +1,7 @@ from panda3d.core import AmbientLight, DirectionalLight def GenerateModel(self, position, scale, hpr, parent, path): + model = self.loader.loadModel(path) model.setPos(*position) model.setScale(*scale) diff --git a/Virtual Environment/main.py b/VirtualEnvironment/main_sim.py similarity index 99% rename from Virtual Environment/main.py rename to VirtualEnvironment/main_sim.py index feac424..905dffa 100644 --- a/Virtual Environment/main.py +++ b/VirtualEnvironment/main_sim.py @@ -10,8 +10,9 @@ load_prc_file('myConfig.prc') -class MyApp(ShowBase): +class MyApp(ShowBase): + xCoord = 0 yCoord = 0 angle = 180 @@ -28,19 +29,21 @@ class MyApp(ShowBase): score = 0 star_angle = 0 last_message_time = 0 - camera_pos = 0 dir_list = ['left', 'right', 'backward', 'forward'] prev_sec = 0 + + + def __init__(self): + ShowBase.__init__(self) self.setBackgroundColor(0.95, 2.45, 2.45) simplepbr.init() - self.accept('d', self.ChangeSpherePositionRightStart) self.accept('d-up', self.ChangeSpherePositionRightEnd) self.accept('a', self.ChangeSpherePositionLeftStart) @@ -295,7 +298,6 @@ def ChooseDirection(self, task): self.index = 0 - for i in self.obj_coords: pos_tuple = tuple(pos) diff --git a/Virtual Environment/models/brain.bam b/VirtualEnvironment/models/brain.bam similarity index 100% rename from Virtual Environment/models/brain.bam rename to VirtualEnvironment/models/brain.bam diff --git a/Virtual Environment/models/plane.bam b/VirtualEnvironment/models/plane.bam similarity index 100% rename from Virtual Environment/models/plane.bam rename to VirtualEnvironment/models/plane.bam diff --git a/Virtual Environment/models/star.bam b/VirtualEnvironment/models/star.bam similarity index 100% rename from Virtual Environment/models/star.bam rename to VirtualEnvironment/models/star.bam diff --git a/Virtual Environment/models/star_texture.jpg b/VirtualEnvironment/models/star_texture.jpg similarity index 100% rename from Virtual Environment/models/star_texture.jpg rename to VirtualEnvironment/models/star_texture.jpg diff --git a/Virtual Environment/models/water.png b/VirtualEnvironment/models/water.png similarity index 100% rename from Virtual Environment/models/water.png rename to VirtualEnvironment/models/water.png diff --git a/Virtual Environment/myConfig.prc b/VirtualEnvironment/myConfig.prc similarity index 100% rename from Virtual Environment/myConfig.prc rename to VirtualEnvironment/myConfig.prc diff --git a/Virtual Environment/requirements.txt b/VirtualEnvironment/requirements.txt similarity index 100% rename from Virtual Environment/requirements.txt rename to VirtualEnvironment/requirements.txt diff --git a/Virtual Environment/README_SOFTWARE.md b/mainmenu/README_SOFTWARE.md similarity index 84% rename from Virtual Environment/README_SOFTWARE.md rename to mainmenu/README_SOFTWARE.md index 9164dfb..395f586 100644 --- a/Virtual Environment/README_SOFTWARE.md +++ b/mainmenu/README_SOFTWARE.md @@ -3,34 +3,40 @@ Make sure to install the required Python libraries. Running the command `pip install -r requirements.txt` will download each of the required libraries to successfully execute this project. -# Virtual Environment +# Main Menu + +To run the main menu: Execute `python mainmenu/menu.py` + +This menu presents 3 options, each pertaining to a particular game. They are the following: + +## Virtual Environment

-To run the virtual environment: Execute `python /Virtual Environment/main.py` +To run the virtual environment: Execute `python Virtual\ Environment/main.py` The main objective is to collect as many stars within a given timeframe. A user may control the object using data received from the EEG, or can modify the functions to accept key inputs. See Panda3D Documentation. -# 2D Game +## 2D Game

The main objective of this game is to keep the black box within the green bar for as long as possible. The EEG will use power density concentration measurements to determine the adqueate placement of the black box. The higher the concentration, the higher the box will go up the red bar. -# 30s Game +## 30s Game Almost identical to the 2D Game, except there is a 30 second timer as well as random placement of the green box every 5 seconds. # Data Collection GUI -To run GUI: Execute `python /Data\ Collection/main.py` +To run GUI: Execute `python Data\ Collection/main.py` The GUI presents 2 options. Selecting "Imagery" will assume that the EEG will be classifiyng motor-imagery tasks. Selecting "Real" implies the actual movement of the instructed task. diff --git a/mainmenu/menu.py b/mainmenu/menu.py new file mode 100644 index 0000000..96f76ff --- /dev/null +++ b/mainmenu/menu.py @@ -0,0 +1,55 @@ +import tkinter as tk +import sys +import os + + +class MainMenu(tk.Frame): + def __init__(self, master=None): + super().__init__(master) + self.master = master + self.pack(expand=True) + self.create_widgets() + + def create_widgets(self): + + self.button_frame = tk.Frame(self) + self.button_frame.pack(expand=True) + + self.button1 = tk.Button(self.button_frame, text="Run Virtual Environment", command=self.run_venv) + self.button1.pack(side="top", pady=10) + + self.button2 = tk.Button(self.button_frame, text="Run 30s Game", command=self.run_30sgame) + self.button2.pack(side="bottom", pady=10) + + self.button3 = tk.Button(self.button_frame, text="Run 2D Game", command=self.run_2dgame) + self.button3.pack(side="top", pady=20) + + def run_venv(self): + + os.system("python VirtualEnvironment/main_sim.py") + + def run_2dgame(self): + + os.system("python 2DGame/main.py") + + def run_30sgame(self): + + os.system("python 30s\ Game/main.py") + +if __name__ == '__main__': + root = tk.Tk() + + root.title("Main Menu") + + screen_width = root.winfo_screenwidth() + screen_height = root.winfo_screenheight() + window_width = 300 + window_height = 200 + x_pos = (screen_width - window_width) // 2 + y_pos = (screen_height - window_height) // 2 + + root.geometry("{}x{}+{}+{}".format(window_width, window_height, x_pos, y_pos)) + app = MainMenu(master=root) + app.mainloop() + + exit(0) \ No newline at end of file