|
|
|
from game.personnage import *
|
|
|
|
from game.core import Game
|
|
|
|
|
|
|
|
import graphics.layers as layers
|
|
|
|
from graphics.engine import Screen
|
|
|
|
import graphics.key_listener as listener
|
|
|
|
|
|
|
|
from util.sqlite import Connection
|
|
|
|
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
conn = Connection()
|
|
|
|
conn.db.execute(
|
|
|
|
"""CREATE TABLE IF NOT EXISTS personnages (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
nom VARCHAR(50) NOT NULL,
|
|
|
|
pdv INTEGER NOT NULL,
|
|
|
|
exp INTEGER NOT NULL,
|
|
|
|
cat VARCHAR(50) NOT NULL,
|
|
|
|
expcoef INTEGER NOT NULL
|
|
|
|
)""")
|
|
|
|
|
|
|
|
conn.db.execute(
|
|
|
|
"""CREATE TABLE IF NOT EXISTS inventaire (
|
|
|
|
personnage_id INTEGER,
|
|
|
|
slot INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
item_type VARCHAR(50) NOT NULL,
|
|
|
|
FOREIGN KEY (personnage_id) REFERENCES personnages(id)
|
|
|
|
UNIQUE (personnage_id, slot)
|
|
|
|
)""")
|
|
|
|
conn.close()
|
|
|
|
|
|
|
|
#Initialise la partie graphique
|
|
|
|
game = Game()
|
|
|
|
screen = Screen(game)
|
|
|
|
layers.StartPopUp(1)
|
|
|
|
layers.GUI(2)
|
|
|
|
|
|
|
|
listener.build_thread(screen).start()
|
|
|
|
|
|
|
|
while True:
|
|
|
|
screen.draw()
|
|
|
|
sleep(0.4)
|