Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
GiuseppePrisco committed Sep 24, 2023
1 parent 83aaf75 commit a59824e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
Binary file added Documentation.pdf
Binary file not shown.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/9ItdZzWA)
<!-- [![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/9ItdZzWA) -->


# Super Mario Runner

<br />
<br />
<p align="center">
<img alt="Super Mario Runner" title="Super Mario Runner" src="./assets/images/favicon.jpg" width="300">
</p>

This is the Final Project for the course of Interactive Graphics, A.Y. 2022/2023.

>Student: Giuseppe Prisco `1895709`
## 📚 Libraries used in the Project

- **THREE.js**: [Official Website 🔗](https://threejs.org/) [[Documentation 🔗](https://threejs.org/docs/)]

It is a lightweight, cross-browser JavaScript library and application programming interface used to create and display animated 3D computer graphics in a web browser using WebGL.

- **Tween.js** [Official Website 🔗](https://github.com/tweenjs/tween.js) [[Documentation 🔗](https://github.com/tweenjs/tween.js/blob/main/docs/user_guide.md)]

It is an open source Javascript tweening engine for creating simple programmatic animations.

## 📜 Project Documentation

- [Documentation 🔗](./documentation.pdf)

In this file I present a technical presentation of the project as well as a user manual to explore every aspect of the game.

## 🌐 Browsers

<!-- DOUBLE CHECK -->
|Browser|Performance|recommended|
|:---|:---|:---:|
|Edge|Good Performance|⭐⭐⭐|
|Chrome|Good Performance on some computers|⭐⭐|
|Firefox|Bad Performance||
|Safari|Bad Performance||

## 🎮 Play the game

<b>Game commands</b>

- `A` or `⬅️`: move left
- `D` or `➡️`: move right
- `W` or `⬆️`: jump
- `S` or `⬇️`: slide
- `Space` or `Escape`: pause and resume game

### Play the game at the following link: [https://sapienzainteractivegraphicscourse.github.io/final-project-prisco_interactivegraphics22-23/](https://sapienzainteractivegraphicscourse.github.io/final-project-prisco_interactivegraphics22-23/)

5 changes: 3 additions & 2 deletions js/animations.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ function characterIdleAnimation(character) {


function moveCharacterForward(scene, camera, directionalLight, directionalLightTarget) {

/* ----- BODY MOVEMENT ----- */
var animationTime = (-settings.endPosition / settings.speed)*1000;

Expand Down Expand Up @@ -3227,9 +3228,9 @@ function initMatrix() {

// SPACE
if(settings.environment == "space") {
var spawnProbability = 0.5;
var spawnProbability = 0.25;
if(settings.quality == "low") {
spawnProbability = 0.3;
spawnProbability = 0.1;
}
for(var x=1; x<iMax; x=x+3) {
for(var y=Math.floor(jMax/2)-6; y<Math.floor(jMax/2); y=y+3) {
Expand Down
14 changes: 13 additions & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ function load3dModels() {
}
};


document.getElementById("progressBar").style.width = 0;
document.getElementById("progressBar-text").innerHTML = "0%";

modelsLoaderManager.onProgress = (url, itemsLoaded, itemsTotal) => {
console.log("Loading models... ", (itemsLoaded / itemsTotal * 100).toFixed(2), '%');
document.getElementById("progressBar").style.width = (itemsLoaded / itemsTotal * 100) + "%" ;
Expand Down Expand Up @@ -300,6 +304,10 @@ function loadTextures() {
}
};


document.getElementById("progressBar").style.width = 0;
document.getElementById("progressBar-text").innerHTML = "0%";

texturesLoaderManager.onProgress = (url, itemsLoaded, itemsTotal) => {
console.log("Loading textures... ", (itemsLoaded / itemsTotal * 100).toFixed(2), '%');
document.getElementById("progressBar").style.width = (itemsLoaded / itemsTotal * 100) + "%" ;
Expand Down Expand Up @@ -338,6 +346,10 @@ function loadSounds() {
}
};


document.getElementById("progressBar").style.width = 0;
document.getElementById("progressBar-text").innerHTML = "0%";

soundsLoaderManager.onProgress = (url, itemsLoaded, itemsTotal) => {
console.log("Loading sounds... ", (itemsLoaded / itemsTotal * 100).toFixed(2), '%');
document.getElementById("progressBar").style.width = (itemsLoaded / itemsTotal * 100) + "%" ;
Expand Down Expand Up @@ -481,7 +493,7 @@ function initScene() {

function startGame() {

let variables = Object.keys(window);
// let variables = Object.keys(window);
// console.log(variables);

rendererSize.x = 1.0;
Expand Down

0 comments on commit a59824e

Please sign in to comment.