Commit 1d7fd718 authored by Dennis Willers's avatar Dennis Willers 🏀

Delete unnessecary code

parent 534553a2
Pipeline #348 passed with stages
in 3 minutes and 18 seconds
......@@ -10,38 +10,10 @@ Http.listen(3000, () => {
console.log("Listening at :3000...");
});
var position = {
x: 200,
y: 200
};
var currentCard = {};
Socketio.on("connection", socket => {
console.log('new Socket connect');
socket.emit("position", position);
socket.on("move", data => {
console.log('Data: ', data);
switch(data) {
case "left":
console.log('left');
position.x -= 5;
Socketio.emit("position", position);
break;
case "right":
position.x += 5;
Socketio.emit("position", position);
break;
case "up":
position.y -= 5;
Socketio.emit("position", position);
break;
case "down":
position.y += 5;
Socketio.emit("position", position);
break;
}
});
for (var key in currentCard) {
socket.emit(key, currentCard[key])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment