Skip to content

Commit d90880c

Browse files
committed
Pushed Files
1 parent 43970ad commit d90880c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+3249
-0
lines changed

Font/Pixeltype.ttf

13.4 KB
Binary file not shown.

Sound/1/1.mp3

19.2 KB
Binary file not shown.

Sound/1/2.mp3

12.2 KB
Binary file not shown.

Sound/MysticalForest1.wav

22 MB
Binary file not shown.

Sprites/Background/Background.png

73.2 KB

Sprites/Background/Layer_0000_9.png

7.62 KB

Sprites/Background/Layer_0001_8.png

10.6 KB

Sprites/Character 1/Attack1/1.png

955 Bytes

Sprites/Character 1/Attack1/2.png

889 Bytes

Sprites/Character 1/Attack1/3.png

885 Bytes

Sprites/Character 1/Attack1/4.png

881 Bytes

Sprites/Character 1/Attack1/5.png

969 Bytes

Sprites/Character 1/Attack1/6.png

893 Bytes

Sprites/Character 1/Attack2/1.png

1007 Bytes

Sprites/Character 1/Attack2/2.png

1012 Bytes

Sprites/Character 1/Attack2/3.png

1003 Bytes

Sprites/Character 1/Attack2/4.png

993 Bytes

Sprites/Character 1/Attack2/5.png

958 Bytes

Sprites/Character 1/Attack2/6.png

914 Bytes

Sprites/Character 1/Death/1.png

1.02 KB

Sprites/Character 1/Death/2.png

1.01 KB

Sprites/Character 1/Death/3.png

979 Bytes

Sprites/Character 1/Death/4.png

959 Bytes

Sprites/Character 1/Death/5.png

875 Bytes

Sprites/Character 1/Death/6.png

883 Bytes

Sprites/Character 1/Fall/1.png

1.04 KB

Sprites/Character 1/Fall/2.png

1.01 KB

Sprites/Character 1/Idle/1.png

1.07 KB

Sprites/Character 1/Idle/2.png

1.04 KB

Sprites/Character 1/Idle/3.png

1.03 KB

Sprites/Character 1/Idle/4.png

1.02 KB

Sprites/Character 1/Idle/5.png

1.03 KB

Sprites/Character 1/Idle/6.png

1.02 KB

Sprites/Character 1/Idle/7.png

1.03 KB

Sprites/Character 1/Idle/8.png

1.06 KB

Sprites/Character 1/Jump/1.png

986 Bytes

Sprites/Character 1/Jump/2.png

1019 Bytes

Sprites/Character 1/Run/1.png

921 Bytes

Sprites/Character 1/Run/2.png

915 Bytes

Sprites/Character 1/Run/3.png

922 Bytes

Sprites/Character 1/Run/4.png

930 Bytes

Sprites/Character 1/Run/5.png

936 Bytes

Sprites/Character 1/Run/6.png

919 Bytes

Sprites/Character 1/Run/7.png

920 Bytes

Sprites/Character 1/Run/8.png

923 Bytes

Sprites/Character 1/Take Hit/1.png

1.66 KB

Sprites/Character 1/Take Hit/2.png

838 Bytes

Sprites/Character 1/Take Hit/3.png

1.63 KB

Sprites/Character 1/Take Hit/4.png

1.56 KB

Sprites/Character 2/Attack1/1.png

1.05 KB

Sprites/Character 2/Attack1/2.png

1 KB

Sprites/Character 2/Attack1/3.png

987 Bytes

Sprites/Character 2/Attack1/4.png

985 Bytes

Sprites/Character 2/Attack1/5.png

902 Bytes

Sprites/Character 2/Attack1/6.png

887 Bytes

Sprites/Character 2/Attack1/7.png

808 Bytes

Sprites/Character 2/Attack2/1.png

778 Bytes

Sprites/Character 2/Attack2/2.png

720 Bytes

Sprites/Character 2/Attack2/3.png

687 Bytes

Sprites/Character 2/Attack2/4.png

1 KB

Sprites/Character 2/Attack2/5.png

924 Bytes

Sprites/Character 2/Attack2/6.png

844 Bytes

Sprites/Character 2/Death/1.png

1.01 KB

Sprites/Character 2/Death/2.png

1.02 KB

Sprites/Character 2/Death/3.png

1007 Bytes

Sprites/Character 2/Death/4.png

851 Bytes

Sprites/Character 2/Death/5.png

777 Bytes

Sprites/Character 2/Death/6.png

804 Bytes

Sprites/Character 2/Death/7.png

771 Bytes

Sprites/Character 2/Death/8.png

785 Bytes

Sprites/Character 2/Death/9.png

787 Bytes

Sprites/Character 2/Death/90.png

584 Bytes

Sprites/Character 2/Death/91.png

572 Bytes

Sprites/Character 2/Fall/1.png

1016 Bytes

Sprites/Character 2/Fall/2.png

1022 Bytes

Sprites/Character 2/Fall/3.png

1001 Bytes

Sprites/Character 2/Idle/1.png

1.04 KB

Sprites/Character 2/Idle/2.png

1.05 KB

Sprites/Character 2/Idle/3.png

1.06 KB

Sprites/Character 2/Idle/4.png

1.05 KB

Sprites/Character 2/Idle/5.png

1.04 KB

Sprites/Character 2/Idle/6.png

1.05 KB

Sprites/Character 2/Idle/7.png

1.05 KB

Sprites/Character 2/Idle/8.png

1.04 KB

Sprites/Character 2/Idle/9.png

1.04 KB

Sprites/Character 2/Idle/90.png

1.04 KB

Sprites/Character 2/Jump/1.png

1.03 KB

Sprites/Character 2/Jump/2.png

1.04 KB

Sprites/Character 2/Jump/3.png

1.04 KB

Sprites/Character 2/Run/1.png

848 Bytes

Sprites/Character 2/Run/2.png

839 Bytes

Sprites/Character 2/Run/3.png

833 Bytes

Sprites/Character 2/Run/4.png

805 Bytes

Sprites/Character 2/Run/5.png

830 Bytes

Sprites/Character 2/Run/6.png

834 Bytes

Sprites/Character 2/Run/7.png

807 Bytes

Sprites/Character 2/Run/8.png

806 Bytes

Sprites/Character 2/Take Hit/1.png

1.5 KB

Sprites/Character 2/Take Hit/2.png

1.55 KB

Sprites/Character 2/Take Hit/3.png

1.52 KB
1.47 KB
Binary file not shown.

__pycache__/network.cpython-311.pyc

2.07 KB
Binary file not shown.

__pycache__/particles.cpython-311.pyc

2.66 KB
Binary file not shown.

__pycache__/player.cpython-311.pyc

10.5 KB
Binary file not shown.

__pycache__/settings.cpython-311.pyc

236 Bytes
Binary file not shown.

__pycache__/support.cpython-311.pyc

1.08 KB
Binary file not shown.

build/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
3+
node_modules/

build/app.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const path = require('path');
2+
3+
const dbconnection = require('./utils/db');
4+
5+
const express = require('express');
6+
const bodyParser = require('body-parser');
7+
8+
const app = express();
9+
10+
app.set('view engine', 'ejs');
11+
app.set('views', 'views');
12+
13+
const routes = require('./routes/route');
14+
15+
app.use(express.json());
16+
17+
app.use(bodyParser.urlencoded({ extended: false }));
18+
app.use(express.static(path.join(__dirname, 'public')));
19+
20+
app.use(routes);
21+
22+
const port = 8000
23+
const host = "localhost"
24+
25+
dbconnection().then(() => {
26+
app.listen(port, () => {
27+
console.log(`Server running at http://${host}:${port}/`);
28+
});
29+
}).catch((error) => {
30+
console.error("Error starting the server: ", error.message);
31+
});

build/controller/admin.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
exports.loginUser = (req, res, next) => {
2+
res.render('login/index',);
3+
};
4+
5+
exports.singupUser = (req, res, next) => {
6+
res.render('register/index',);
7+
};
8+
9+
exports.logout = (req, res, next) => {
10+
res.render('includes/successLogout',);
11+
};

build/controller/login.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const User = require("../schema/Schema");
2+
3+
const bcrypt = require("bcryptjs");
4+
const env = require("dotenv");
5+
const { createSecretToken } = require("../utils/generateToken");
6+
7+
env.config();
8+
9+
const login = async(req, res) => {
10+
const { password, username } = req.body;
11+
12+
if (!(username && password)) {
13+
return res.json({ authentication: false });
14+
}
15+
16+
const user = await User.findOne({ username });
17+
18+
if (!(user && (await bcrypt.compare(password, user.password)))) {
19+
return res.json({ authentication: false });
20+
}
21+
22+
const token = createSecretToken(user._id);
23+
24+
res.cookie("token", token, {
25+
domain: process.env.MONGODB_URL, // Set your domain here
26+
path: "/", // Cookie is accessible from all paths
27+
expires: new Date(Date.now() + 86400000), // Cookie expires in 1 day
28+
secure: true, // Cookie will only be sent over HTTPS
29+
httpOnly: true, // Cookie cannot be accessed via client-side scripts
30+
sameSite: "None",
31+
});
32+
33+
res.json({ token, authentication: true });
34+
};
35+
module.exports = login;

build/controller/singup.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const User = require("../schema/Schema");
2+
3+
const { createSecretToken } = require("../utils/generateToken");
4+
const bcrypt = require("bcryptjs");
5+
6+
const createUser = async (req, res) => {
7+
try {
8+
if (!(req.body.email && req.body.password && req.body.name && req.body.username)) {
9+
res.status(400).send("Todos os campos são obrigatórios");
10+
}
11+
12+
const oldUser = await User.findOne({ email: req.body.email });
13+
14+
if (oldUser) {
15+
return res.status(409).send("User com esse e-mail já existe!");
16+
}
17+
18+
const salt = 10;
19+
const hashedPassword = await bcrypt.hash(req.body.password, salt);
20+
21+
const newUser = new User({
22+
name: req.body.name,
23+
username: req.body.username,
24+
email: req.body.email,
25+
password: hashedPassword,
26+
});
27+
28+
const user = await newUser.save();
29+
const token = createSecretToken(user._id);
30+
31+
res.cookie("token", token, {
32+
path: "/", // Cookie is accessible from all paths
33+
expires: new Date(Date.now() + 86400000), // Cookie expires in 1 day
34+
secure: true, // Cookie will only be sent over HTTPS
35+
httpOnly: true, // Cookie cannot be accessed via client-side scripts
36+
sameSite: "None",
37+
});
38+
39+
console.log("cookie criado com sucesso!");
40+
41+
res.json(user);
42+
} catch(err) {
43+
console.log("Erro: ", err)
44+
}
45+
};
46+
module.exports = createUser;
47+

0 commit comments

Comments
 (0)