Code: Select all
import Player from './Player.mjs';
import Collectible from './Collectible.mjs';
const socket = io();
const canvas = document.getElementById('game-window');
const context = canvas.getContext('2d');
const load = () => {
context.fillStyle = "#000000";
context.fillRect(0, 0, canvas.width, canvas.height);
context.font = "30px Comic Sans MS";
context.fillStyle = "red";
context.textAlign = "center";
context.fillText("Coin Race", 100, 30);
context.strokeStyle = "yellow";
context.strokeRect(5, 35, canvas.width - 10, canvas.height - 40)
}
load();
Code: Select all
Secure Real-Time Multiplayer Game
Secure Real Time Multiplayer Game
Kann Sag mir bitte jemand, was ich falsch mache.
Mir fällt auf, dass das externe Skript ausgeführt wird, wenn ich das Folgende in game.mjs auskommentiere
Code: Select all
import Player from './Player.mjs';
import Collectible from './Collectible.mjs';
const socket = io();