diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8d51a4f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Dreadnought", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 76745db..e18c45c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# CSC290: Battleship -See the [Project Plan](project-plan.md) +# DreadNought - Readme +[toc] + +## Screenshots + + + +## Introduction + +**DreadNought** is a game based upon well-known classic game of **[Battleship](https://en.wikipedia.org/wiki/Battleship)**. In this two-player game you place *ships* of varying lengths onto a grid of 10x10 tiles. In this game each player is not allowed to see the other player's board, instead the players take turns firing *missiles* onto the opponents board and are told if they hit a ship or not. ***The objective of the game*** is to sink all of your opponents ships, at which point you have won. \ No newline at end of file diff --git a/src/gui/app.py b/src/gui/app.py index e2b9d5c..462140d 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -3,6 +3,10 @@ from gui.guiboard import guiboard from enum import Enum from model.Controller import controller +import pathlib + +def relative(fn): + return pathlib.Path(__file__).parent / 'my_file' class App: @@ -10,8 +14,8 @@ class App: fill_color = (255, 255, 255) # RGB white - background = pygame.image.load('resources/background.jpg') - title = pygame.image.load('resources/title.png') + background = pygame.image.load(relative('resources/background.jpg')) + title = pygame.image.load(relative('resources/title.png')) arial = pygame.font.SysFont("Arial", 30) diff --git a/src/gui/button.py b/src/gui/button.py index 56af40a..e167b81 100644 --- a/src/gui/button.py +++ b/src/gui/button.py @@ -1,4 +1,4 @@ -import pygame, gui.app +import pygame, app from collections import namedtuple Style = namedtuple("Style", "bg hbg tcolor") diff --git a/src/model/AIPlayer.py b/src/model/aiplayer similarity index 100% rename from src/model/AIPlayer.py rename to src/model/aiplayer diff --git a/src/model/Board.py b/src/model/board.py similarity index 100% rename from src/model/Board.py rename to src/model/board.py diff --git a/src/model/Controller.py b/src/model/controller.py similarity index 100% rename from src/model/Controller.py rename to src/model/controller.py