player class
This commit is contained in:
5
board.py
Normal file
5
board.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class Board():
|
||||||
|
def __init__(self, board):
|
||||||
|
self.board = board
|
||||||
|
|
||||||
|
|
||||||
6
main.py
6
main.py
@@ -1,6 +1,7 @@
|
|||||||
import pygame
|
import pygame
|
||||||
import sys
|
import sys
|
||||||
from constants import *
|
from constants import *
|
||||||
|
from player import *
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Starting BattleShip!")
|
print("Starting BattleShip!")
|
||||||
@@ -24,10 +25,13 @@ def main():
|
|||||||
good_inp, player_board = check_valid_input(inp)
|
good_inp, player_board = check_valid_input(inp)
|
||||||
enemy_board = player_board.copy()
|
enemy_board = player_board.copy()
|
||||||
|
|
||||||
|
player = Player(player_board)
|
||||||
|
enemy = Player(enemy_board)
|
||||||
|
|
||||||
|
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
for j in range(10):
|
for j in range(10):
|
||||||
print(f"{board[i][j]} ", end="")
|
print(f"{player.board[i][j]} ", end="")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
|
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
|
||||||
|
|||||||
Reference in New Issue
Block a user