From 0d89b1ce841f4066c5522a0676c572a159f7cdc8 Mon Sep 17 00:00:00 2001 From: steev Date: Wed, 6 Dec 2023 18:46:17 +0100 Subject: [PATCH] added card data --- Game Client/Classes/System/App.py | 46 ++++++++++++++++++ .../Cards/testmonstercard/artworkjson.png | Bin 0 -> 2389 bytes .../testmonstercard/testmonstercard.json | 16 ++++++ .../Cards/testspellcard/artworkjson.png | Bin 0 -> 2389 bytes .../Cards/testspellcard/testspellcard.json | 6 +++ .../Assets/Cards/testtrapcard/artworkjson.png | Bin 0 -> 2389 bytes .../Cards/testtrapcard/testtrapcard.json | 6 +++ 7 files changed, 74 insertions(+) create mode 100644 Game Client/Classes/System/App.py create mode 100644 Game_Client/Assets/Cards/testmonstercard/artworkjson.png create mode 100644 Game_Client/Assets/Cards/testmonstercard/testmonstercard.json create mode 100644 Game_Client/Assets/Cards/testspellcard/artworkjson.png create mode 100644 Game_Client/Assets/Cards/testspellcard/testspellcard.json create mode 100644 Game_Client/Assets/Cards/testtrapcard/artworkjson.png create mode 100644 Game_Client/Assets/Cards/testtrapcard/testtrapcard.json diff --git a/Game Client/Classes/System/App.py b/Game Client/Classes/System/App.py new file mode 100644 index 0000000..e6881be --- /dev/null +++ b/Game Client/Classes/System/App.py @@ -0,0 +1,46 @@ +import pygame +from pygame.locals import * + +from Classes.System.Window import Window +from Classes.System.InputHandler import InputHandler + + +class App: + + __window:Window + __running:bool = True + __player = pygame.Rect((300,250, 50,50)) + __FPS = 60 + __speed = 5 + __clock = pygame.time.Clock() + + def __init__(self, width:int=800, height:int=600, title:str="default title"): + self.__window = Window(width=width, height=height, title=title) + self.startGameLoop() + self.onCleanup() + + def startGameLoop(self): + while self.__running: + + self.__clock.tick(self.__FPS) + + #temporary refresh + self.__window.clea().fill((0,0,0)) + pygame.draw.rect(self.__window.getScreen(), (255,0,0), self.__player) + + self.__player.move_ip((InputHandler.getInputAxis()[0]*self.__speed),(InputHandler.getInputAxis()[1]*self.__speed)) + + # event handler + for event in pygame.event.get(): + if event.type == pygame.QUIT: + self.onCleanup() + + # emits update to the game + pygame.display.update() + + def setRunning(self, running:bool): + self.__running = running + + def onCleanup(self): + self.__running = False + pygame.quit() \ No newline at end of file diff --git a/Game_Client/Assets/Cards/testmonstercard/artworkjson.png b/Game_Client/Assets/Cards/testmonstercard/artworkjson.png new file mode 100644 index 0000000000000000000000000000000000000000..9955a0cbf1966ebc0956bef3cc107754ed7011da GIT binary patch literal 2389 zcmeAS@N?(olHy`uVBq!ia0y~yV2WU1VEn?t1{8T15PXG!fm6oQ#WAE}&fA-TE1d#G zTrbu>Wi@D!FEF zConP`VG(0+@EK){2Eu4c7|jI(oeSQ)FW6NT{NVMq>&1EhyA>OJBl@P7nyP-teg8c9 z-SfS&4Za^-IT!?lfhD0~BkL$*G!RBp!e}nQ%mqtl{$%KP6?(pDVM0Byxy0b<>gTe~ HDWM4fLIJZ> literal 0 HcmV?d00001 diff --git a/Game_Client/Assets/Cards/testmonstercard/testmonstercard.json b/Game_Client/Assets/Cards/testmonstercard/testmonstercard.json new file mode 100644 index 0000000..f8e3476 --- /dev/null +++ b/Game_Client/Assets/Cards/testmonstercard/testmonstercard.json @@ -0,0 +1,16 @@ +{ + "name": "testmonster", + "image":"Assets/Cards/testmonstercard/artwork.png", + "costs": 30, + "defence": 40, + "attacks":[ + { + "name":"test attack", + "damage":80 + }, + { + "name":"test attack", + "damage":80 + } + ] +} diff --git a/Game_Client/Assets/Cards/testspellcard/artworkjson.png b/Game_Client/Assets/Cards/testspellcard/artworkjson.png new file mode 100644 index 0000000000000000000000000000000000000000..9955a0cbf1966ebc0956bef3cc107754ed7011da GIT binary patch literal 2389 zcmeAS@N?(olHy`uVBq!ia0y~yV2WU1VEn?t1{8T15PXG!fm6oQ#WAE}&fA-TE1d#G zTrbu>Wi@D!FEF zConP`VG(0+@EK){2Eu4c7|jI(oeSQ)FW6NT{NVMq>&1EhyA>OJBl@P7nyP-teg8c9 z-SfS&4Za^-IT!?lfhD0~BkL$*G!RBp!e}nQ%mqtl{$%KP6?(pDVM0Byxy0b<>gTe~ HDWM4fLIJZ> literal 0 HcmV?d00001 diff --git a/Game_Client/Assets/Cards/testspellcard/testspellcard.json b/Game_Client/Assets/Cards/testspellcard/testspellcard.json new file mode 100644 index 0000000..51d4083 --- /dev/null +++ b/Game_Client/Assets/Cards/testspellcard/testspellcard.json @@ -0,0 +1,6 @@ +{ + "name": "testspell", + "image":"Assets/Cards/testspelltcard/artwork.png", + "costs": 30, + "description":"this is a test spell card" +} \ No newline at end of file diff --git a/Game_Client/Assets/Cards/testtrapcard/artworkjson.png b/Game_Client/Assets/Cards/testtrapcard/artworkjson.png new file mode 100644 index 0000000000000000000000000000000000000000..9955a0cbf1966ebc0956bef3cc107754ed7011da GIT binary patch literal 2389 zcmeAS@N?(olHy`uVBq!ia0y~yV2WU1VEn?t1{8T15PXG!fm6oQ#WAE}&fA-TE1d#G zTrbu>Wi@D!FEF zConP`VG(0+@EK){2Eu4c7|jI(oeSQ)FW6NT{NVMq>&1EhyA>OJBl@P7nyP-teg8c9 z-SfS&4Za^-IT!?lfhD0~BkL$*G!RBp!e}nQ%mqtl{$%KP6?(pDVM0Byxy0b<>gTe~ HDWM4fLIJZ> literal 0 HcmV?d00001 diff --git a/Game_Client/Assets/Cards/testtrapcard/testtrapcard.json b/Game_Client/Assets/Cards/testtrapcard/testtrapcard.json new file mode 100644 index 0000000..6d1cd5a --- /dev/null +++ b/Game_Client/Assets/Cards/testtrapcard/testtrapcard.json @@ -0,0 +1,6 @@ +{ + "name": "testtrap", + "image":"Assets/Cards/testtrapcard/artwork.png", + "costs": 30, + "description":"this is a test tryp card" +} \ No newline at end of file