Skip to content

Commit

Permalink
last few fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amgno committed Jan 21, 2024
1 parent 1d9678c commit c5754ef
Show file tree
Hide file tree
Showing 14 changed files with 2,070 additions and 42 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified assets/.DS_Store
Binary file not shown.
Binary file added assets/Hbc.ttf
Binary file not shown.
Binary file added assets/HelveticaNeue.ttc
Binary file not shown.
Binary file modified assets/images/.DS_Store
Binary file not shown.
Binary file modified assets/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/crediti.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/oldbackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,976 changes: 1,976 additions & 0 deletions assets/images/plat2.ai

Large diffs are not rendered by default.

Binary file modified assets/images/vecchia3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 46 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
<!doctype html>
<html>
<head>
<title>My first game!</title>
<script src="lib/phaser.min.js"></script> <!--L'ordine è importante, va prima inizializzato phaser e poi la nostra versione custom-->
<script src="lib/poliphaser.js"></script>

<!--Scene vanno messe prima del main-->
<script src="src/scenes/menu.js" type="module"></script>
<script src="src/scenes/storia.js" type="module"></script>
<script src="src/scenes/scene1.js" type="module"></script>
<script src="src/scenes/scene2.js" type="module"></script>
<script src="src/scenes/scene3.js" type="module"></script>
<script src="src/scenes/death.js" type="module"></script>

<script src="src/player.js"></script>
<script src="src/platform.js"></script>
<script src="src/mushroom.js"></script>
<script src="src/rain.js"></script>
<script src="src/egg.js"></script>
<script defer src="src/main.js"></script> <!--defer fa si che si carichi solo dopo che ha caricato tutto il resto-->

</head>
<body>
<div id="game_area" style="text-align: center;"></div>

<!-- PROVA -->
</body>

<head>
<title>My first game!</title>
<style>
@font-face {
font-family: 'hbc';
src: url('assets/Hbc.ttf') format('truetype');
/* Update the path accordingly */
font-weight: normal;
font-style: normal;
}

body {
font-family: 'hbc', sans-serif;
}
</style>
<script src="lib/phaser.min.js"></script>
<!--L'ordine è importante, va prima inizializzato phaser e poi la nostra versione custom-->
<script src="lib/poliphaser.js"></script>

<!--Scene vanno messe prima del main-->
<script src="src/scenes/menu.js" type="module"></script>
<script src="src/scenes/storia.js" type="module"></script>
<script src="src/scenes/scene1.js" type="module"></script>
<script src="src/scenes/scene2.js" type="module"></script>
<script src="src/scenes/scene3.js" type="module"></script>
<script src="src/scenes/death.js" type="module"></script>
<script src="src/scenes/credits.js" type="module"></script>

<script src="src/player.js"></script>
<script src="src/platform.js"></script>
<script src="src/mushroom.js"></script>
<script src="src/rain.js"></script>
<script src="src/egg.js"></script>
<script defer src="src/main.js"></script> <!--defer fa si che si carichi solo dopo che ha caricato tutto il resto-->



</head>

<body>
<div id="game_area" style="text-align: center;"></div>

<!-- PROVA -->
</body>

</html>
32 changes: 32 additions & 0 deletions src/scenes/credits.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
let crediti;

function preload(s){
crediti = PP.assets.image.load(s, "assets/images/crediti.png");
}


function create(s){
// PP.assets.image.add(s, tavola3, 0, 0, 0, 0);
// PP.assets.image.add(s, tavola2, 0, 0, 0, 0);
PP.assets.image.add(s, crediti, 0, 0, 0, 0);
}

function next(s){
PP.scenes.start("menu");
}

var isSelectFunctionCalled = false;
function update(s){

// console.log(tavola);
if (PP.interactive.kb.is_key_down(s, PP.key_codes.SPACE) && !isSelectFunctionCalled) {
next(s);
isSelectFunctionCalled = true;
} else if (!PP.interactive.kb.is_key_down(s, PP.key_codes.SPACE)) {
isSelectFunctionCalled = false;
}
}
function destroy(s){}


PP.scenes.add("crediti", preload, create, update, destroy);
31 changes: 16 additions & 15 deletions src/scenes/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function preload(s) {
}
function create(s) {
PP.assets.image.add(s, menubackground, 0, 0, 0, 0);
txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
txt2 = PP.shapes.text_styled_add(s, 114, 100, "CREDITI", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
txt3 = PP.shapes.text_styled_add(s, 93, 160, "GIOCA", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Hbc", "normal", "0xFFFFFF", null);
txt2 = PP.shapes.text_styled_add(s, 114, 100, "CREDITI", 60, "Hbc", "normal", "0xFFFFFF", null);
txt3 = PP.shapes.text_styled_add(s, 93, 160, "GIOCA", 60, "Hbc", "normal", "0xFFFFFF", null);

}

Expand All @@ -24,19 +24,19 @@ function create(s) {
// console.log(selection);
// if (selection = 0){
// PP.shapes.destroy(txt);
// txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Helvetica Neue Condensed Black", "normal", "0x000000", null);
// txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Hbc", "normal", "0x000000", null);
// selection = selection+1;
// } else if (selection = 1){
// PP.shapes.destroy(txt);
// txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
// txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Hbc", "normal", "0xFFFFFF", null);
// PP.shapes.destroy(txt2);
// txt2 = PP.shapes.text_styled_add(s,114, 100, "CREDITI", 60, "Helvetica Neue Condensed Black", "normal", "0x000000", null);
// txt2 = PP.shapes.text_styled_add(s,114, 100, "CREDITI", 60, "Hbc", "normal", "0x000000", null);
// selection = selection +1;
// } else {
// PP.shapes.destroy(txt2);
// txt2 = PP.shapes.text_styled_add(s, 110, 40, "CREDITI", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
// txt2 = PP.shapes.text_styled_add(s, 110, 40, "CREDITI", 60, "Hbc", "normal", "0xFFFFFF", null);
// PP.shapes.destroy(txt3);
// txt3 = PP.shapes.text_styled_add(s,93, 160, "GIOCA", 60, "Helvetica Neue Condensed Black", "normal", "0x000000", null);
// txt3 = PP.shapes.text_styled_add(s,93, 160, "GIOCA", 60, "Hbc", "normal", "0x000000", null);
// selection = 0;
// }
// }
Expand All @@ -47,23 +47,23 @@ function select(s) {
// console.log(selection);
if (selection === 0) {
PP.shapes.destroy(txt);
txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Helvetica Neue Condensed Black", "normal", "0x000000", null);
txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Hbc", "normal", "0x000000", null);
PP.shapes.destroy(txt3);
txt3 = PP.shapes.text_styled_add(s, 93, 160, "GIOCA", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
txt3 = PP.shapes.text_styled_add(s, 93, 160, "GIOCA", 60, "Hbc", "normal", "0xFFFFFF", null);
selection = selection + 1;
selectionpress = 1;
} else if (selection === 1) {
PP.shapes.destroy(txt);
txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
txt = PP.shapes.text_styled_add(s, 110, 40, "STORIA", 60, "Hbc", "normal", "0xFFFFFF", null);
PP.shapes.destroy(txt2);
txt2 = PP.shapes.text_styled_add(s, 114, 100, "CREDITI", 60, "Helvetica Neue Condensed Black", "normal", "0x000000", null);
txt2 = PP.shapes.text_styled_add(s, 114, 100, "CREDITI", 60, "Hbc", "normal", "0x000000", null);
selection = selection + 1;
selectionpress = 2;
} else {
PP.shapes.destroy(txt2);
txt2 = PP.shapes.text_styled_add(s, 114, 100, "CREDITI", 60, "Helvetica Neue Condensed Black", "normal", "0xFFFFFF", null);
txt2 = PP.shapes.text_styled_add(s, 114, 100, "CREDITI", 60, "Hbc", "normal", "0xFFFFFF", null);
PP.shapes.destroy(txt3);
txt3 = PP.shapes.text_styled_add(s, 93, 160, "GIOCA", 60, "Helvetica Neue Condensed Black", "normal", "0x000000", null);
txt3 = PP.shapes.text_styled_add(s, 93, 160, "GIOCA", 60, "Hbc", "normal", "0x000000", null);
selection = 0;
selectionpress = 3;
}
Expand All @@ -82,7 +82,7 @@ function update(s) {
};

function test2(s) {
PP.scenes.start("storia")
PP.scenes.start("crediti")
PP.scenes.stop("menu");
};

Expand Down Expand Up @@ -116,6 +116,7 @@ function update(s) {
PP.scenes.start("storia");
} else if (selectionpress === 2) {
selection = 0;
PP.scenes.start("crediti");
} else {
selection = 0;
PP.scenes.start("scene1");
Expand Down
1 change: 0 additions & 1 deletion src/scenes/scene3.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ let key3;




function collision(s, player, platform){
if (player.geometry.y <= platform.geometry.y) {
player.is_on_platform = true;
Expand Down

0 comments on commit c5754ef

Please sign in to comment.