Skip to content
Snippets Groups Projects
Commit 889d1fe1 authored by Paul-louis Gomis's avatar Paul-louis Gomis
Browse files

start change typescript

parent 0ba71ff7
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,10 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"javascript.preferences.importModuleSpecifierEnding": "js"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
}
\ No newline at end of file
......@@ -2,6 +2,16 @@ import { Sushi } from "./Ressources.js";
class Player {
image = new Image();
name: Text;
id: number;
x: number;
y: number;
radius: number;
speed: number;
direction: { x: number; y: number };
imageId: number;
imageFolder: Text;
isDead: boolean;
constructor(x, y, radius, imageFolder, id, imageId, name) {
this.name = name;
this.id = id;
......
class Ressources {
x: number;
y: number;
size: number;
image: HTMLImageElement;
drop: boolean;
name: Text;
constructor(name, x, y, size, image) {
this.name = name;
this.x = x;
......
export default class Router {
routes: Object[];
actualRoute: Text;
constructor(routes) {
this.routes = routes;
this.actualRoute = routes[0].page;
......
......@@ -4,8 +4,8 @@ import { Sushi } from "./Ressources.js";
import { io } from "socket.io-client";
const Main = (playerName, playerCharacter) => {
const canvas = document.querySelector(".map");
const ctx = canvas.getContext("2d");
const canvas = document.querySelector(".map") as HTMLCanvasElement;
const ctx = canvas.getContext("2d") as CanvasRenderingContext2D;
canvas.width = document.documentElement.clientWidth;
canvas.height = document.documentElement.clientHeight;
......
This diff is collapsed.
......@@ -7,9 +7,12 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --mode=production",
"build:server": "tsc",
"watch": "webpack --mode=development --watch",
"start": "node .",
"dev": "nodemon server/index.js"
"dev": "nodemon server/index.js",
"test": "jest",
"test:watch": "jest --watch"
},
"author": "Sofiane Lasoa <sofiane.lasoa.etu@univ-lille.fr> (https://gitlab.univ-lille.fr/sofiane.lasoa.etu)",
"homepage": "https://gitlab.univ-lille.fr/sofiane.lasoa.etu/sae-2023-groupei-lasoa-gomis.git",
......@@ -18,11 +21,15 @@
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"babel-loader": "^9.1.2",
"jest": "^29.5.0",
"nodemon": "^2.0.22",
"prettier": "^2.8.3",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"webpack": "^5.78.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
......
{
"compilerOptions": {
"rootDirs": ["server/src", "."],
"outDir": "server/build",
"target": "ES6",
"module": "CommonJS",
"noEmitOnError": true,
"sourceMap": true,
"moduleResolution": "node",
"esModuleInterop": true,
"allowJs": true,
"strict": true,
},
"exclude": ["./node_modules", "./client", "./server/build", "build"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment