Skip to content

Commit

Permalink
fixed some things, added some. New checkpoints. few others don't reme…
Browse files Browse the repository at this point in the history
…mber
  • Loading branch information
amgno committed Jan 18, 2024
1 parent 2cdbba6 commit 1edfc10
Show file tree
Hide file tree
Showing 15 changed files with 451 additions and 97 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified assets/.DS_Store
Binary file not shown.
Binary file modified assets/images/.DS_Store
Binary file not shown.
Binary file added assets/images/deaths/.DS_Store
Binary file not shown.
Binary file added assets/images/level3bg.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 modified assets/images/menu.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 modified assets/images/rain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
426 changes: 376 additions & 50 deletions backup1/lib/poliphaser.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/egg.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function create_egg(s, player){
// Generate a raindrop every 100 milliseconds
setInterval(function () {
generateEgg(s, 1);
PP.physics.set_velocity_x(egg, -800);
PP.physics.set_velocity_x(egg, -700);

}, 1000);
}, 2000);
}


Expand Down
10 changes: 5 additions & 5 deletions src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ function manage_player_update(s, player) {


if (PP.interactive.kb.is_key_up(s, PP.key_codes.SPACE)) {
if(testfallback){
PP.physics.set_velocity_y(player, +player_jump / 1.5);
testfallback = false;
if (testfallback) {
PP.physics.set_velocity_y(player, +player_jump / 1.5);
testfallback = false;
}
}



if (PP.physics.get_velocity_y(player) < 0) {
if (PP.physics.get_velocity_y(player) < 0 && PP.interactive.kb.is_key_down(s, PP.key_codes.SPACE)) {
next_anim = "jump_up";
}

if (PP.physics.get_velocity_y(player) > 0) {
if (PP.physics.get_velocity_y(player) > 300) {
player.is_on_platform = false;
next_anim = "jump_down"
}
Expand Down
21 changes: 20 additions & 1 deletion src/scenes/death.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function preload(s) {
img_death_4 = PP.assets.image.load(s, "assets/images/deaths/spriteidk.png");
img_death_5 = PP.assets.image.load(s, "assets/images/deaths/spritelost.png");
img_death_6 = PP.assets.image.load(s, "assets/images/deaths/spriteraindeath.png");


};
function create(s) {
deathimg = PP.gameState.get_Variable("deathimg");
Expand All @@ -36,11 +38,28 @@ function create(s) {
else if (deathimg === 1) {
PP.assets.image.add(s, img_death_1, 0,0,0,0)
}

hp = 3;
hp2 = 3;
};

function update(s) {
if (PP.interactive.kb.is_key_down(s, PP.key_codes.SPACE)) {
PP.scenes.start("scene3");
if (deathimg === 1){
PP.scenes.start("scene2");
}
if (deathimg === 2){
PP.scenes.start("scene2");
}
if (deathimg === 6){
PP.scenes.start("scene1");
}
if (deathimg === 3){
PP.scenes.start("scene1");
}
if (deathimg === 5){
PP.scenes.start("scene3");
}
}
};

Expand Down
9 changes: 8 additions & 1 deletion src/scenes/menu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//sistemare hover menu colore. --


let menubackground;
let txt;
let txt2;
Expand Down Expand Up @@ -84,15 +87,19 @@ function update(s) {
};

function test3(s) {
PP.scenes.start("scene3")
PP.scenes.start("scene1")
PP.scenes.stop("menu");
};


PP.interactive.mouse.add(txt, "pointerdown", test);
PP.interactive.mouse.add(txt2, "pointerdown", test2);
PP.interactive.mouse.add(txt3, "pointerdown", test3);


//hover



if (PP.interactive.kb.is_key_down(s, PP.key_codes.S) && !isSelectFunctionCalled) {
select(s);
Expand Down
10 changes: 6 additions & 4 deletions src/scenes/scene1.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//aggiungere punti hp +
// sistemare colore
//allargare generazione rain


let img_background;
let player;
Expand All @@ -16,6 +18,7 @@ let testcamera;




function collision(s, player, platform){
// console.log("a")
if(player.geometry.y <= platform.geometry.y){
Expand All @@ -32,6 +35,7 @@ function preload(s) {
vecchia = PP.assets.image.load(s, "assets/images/vecchia.png")
preload_mushrooms(s);
preload_rain(s);

};


Expand All @@ -47,10 +51,10 @@ function create(s) {
background.tile_geometry.flip_y = 1;

// background = PP.assets.image.add(s, img_background, 0 , 0, 0, 0);
player = PP.assets.sprite.add(s, ss_player, 390, 600, 0.5, 1);
player = PP.assets.sprite.add(s, ss_player, 390, 640, 0.5, 1);


floor = PP.shapes.rectangle_add(s, 1040, 640, 3080, 1, "0x000000", 0);
floor = PP.shapes.rectangle_add(s, 1040, 639, 3080, 1, "0x000000", 0);
PP.physics.add(s, player, PP.physics.type.DYNAMIC);
PP.physics.add(s, floor, PP.physics.type.STATIC);

Expand Down Expand Up @@ -180,8 +184,6 @@ function update(s) {


function destroy(s) {


};


Expand Down
4 changes: 1 addition & 3 deletions src/scenes/scene2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// sistemare bug quando sto su nuvole che vanno y+
//sistemare pioggia
// sistemare pioggia



Expand Down Expand Up @@ -96,7 +96,6 @@ function collision_platform(s, player, platform) {
}



function create(s) {
txt_text = PP.shapes.text_styled_add(s, 100, 100, "X X X", 40, "Helvetica", "normal", "0xFFFFFF", null);
player = PP.assets.sprite.add(s, ss_player, 100, 220, 0.5, 1);
Expand Down Expand Up @@ -215,7 +214,6 @@ function update(s) {
txt_text.tile_geometry.scroll_factor_x = 0;
txt_text.tile_geometry.scroll_factor_y = 0;

console.log(hp2);
if (hp2 === 0) {
if (diedfromegg) {
deathhandler(s, 1);
Expand Down
64 changes: 33 additions & 31 deletions src/scenes/scene3.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ let key3;




function collision(s, player, platform){
if (player.geometry.y <= platform.geometry.y) {
player.is_on_platform = true;
Expand All @@ -68,52 +69,53 @@ function collision(s, player, platform){

function preload(s){
ss_player = PP.assets.sprite.load_spritesheet(s, "assets/images/sprite.png", 82.5, 165);
img_background = PP.assets.image.load(s, "assets/images/background3.png");
img_background = PP.assets.image.load(s, "assets/images/level3bg.png");
kimage = PP.assets.image.load(s, "assets/images/key.png")
}
function create(s){
player = PP.assets.sprite.add(s, ss_player, 100, 645, 0.5, 1);
background = PP.assets.image.add(s, img_background, -640, -858, 0, 0);
player = PP.assets.sprite.add(s, ss_player, 100, 644, 0.5, 1);
key1 = PP.assets.image.add(s, kimage, 4682, 1350, 0,0) //ok
key2 = PP.assets.image.add(s, kimage, 3586, -606, 0,0)
key3 = PP.assets.image.add(s, kimage, 400, 200, 0,0)
configure_player_animation(s, player);
PP.physics.add(s, player, PP.physics.type.DYNAMIC);
// PP.shapes.rectangle_add(s, 100,200 ,100,220, "0x000000", 1)

floor = PP.shapes.rectangle_add(s, 232, 722, 1277, 156, "0x000000", 1);
floor = PP.shapes.rectangle_add(s, 232, 722, 1277, 156, "0x000000", 0);

PP.camera.start_follow(s, player,0,250);
PP.physics.add(s, floor, PP.physics.type.STATIC);
PP.physics.add_collider_f(s, player, floor, collision);

tubo1 = PP.shapes.rectangle_add(s, 410, 489, 143.7152, 309.9965, "0x000000", 1);
tubo2 = PP.shapes.rectangle_add(s, 990, 991, 239, 693, "0x000000", 1);
tubo3 = PP.shapes.rectangle_add(s, 1308, 1032, 395, 85, "0x000000", 1);
tubo4 = PP.shapes.rectangle_add(s, 1018, 1425, 1267, 175, "0x000000", 1);
tubo5 = PP.shapes.rectangle_add(s, 718, 12, 1283, 234, "0x000000", 1);
tubo6 = PP.shapes.rectangle_add(s, 1266, 218, 186, 177, "0x000000", 1);
tubo7 = PP.shapes.rectangle_add(s, 1593, 242, 468, 131, "0x000000", 1);
tubo8 = PP.shapes.rectangle_add(s, 1891, 61, 126, 1123, "0x000000", 1);
tubo9 = PP.shapes.rectangle_add(s, 1455, -402, 744, 195, "0x000000", 1);
tubo10 = PP.shapes.rectangle_add(s, 2076, -13, 243, 60, "0x000000", 1);
tubo11 = PP.shapes.rectangle_add(s, 2545, 292, 877, 131, "0x000000", 1);
tubo12 = PP.shapes.rectangle_add(s, 2586, 872, 1678, 143, "0x000000", 1);
tubo13 = PP.shapes.rectangle_add(s, 2965, 599, 335, 124, "0x000000", 1);
tubo14 = PP.shapes.rectangle_add(s, 3279, -27, 292, 1656, "0x000000", 1);
tubo15 = PP.shapes.rectangle_add(s, 3606, 599, 361, 124, "0x000000", 1);
tubo16 = PP.shapes.rectangle_add(s, 2731, -234, 803, 179, "0x000000", 1);
tubo17 = PP.shapes.rectangle_add(s, 3816, -431, 782, 110, "0x000000", 1);
tubo18 = PP.shapes.rectangle_add(s, 4289, -534, 163, 315, "0x000000", 1);
tubo19 = PP.shapes.rectangle_add(s, 2822, 1255, 1988, 164, "0x000000", 1);
tubo20 = PP.shapes.rectangle_add(s, 3650, 1486, 332, 297, "0x000000", 1);
tubo21 = PP.shapes.rectangle_add(s, 4342, 1574, 1051, 122, "0x000000", 1);
tubo22 = PP.shapes.rectangle_add(s, 4526, 1100, 110, 310, "0x000000", 1);
tubo23 = PP.shapes.rectangle_add(s, 4217, 887, 1209, 114, "0x000000", 1);
tubo24 = PP.shapes.rectangle_add(s, 4941, 691, 238, 505, "0x000000", 1);
tubo25 = PP.shapes.rectangle_add(s, 4547, 307, 1026, 262, "0x000000", 1);
tubo26 = PP.shapes.rectangle_add(s, 5360, -179, 1556, 117, "0x000000", 1);
tubo27 = PP.shapes.rectangle_add(s, 5481, -407, 400, 337, "0x000000", 1);
tubo28 = PP.shapes.rectangle_add(s, 5849, -514, 336, 121, "0x000000", 1);
tubo1 = PP.shapes.rectangle_add(s, 410, 489, 143.7152, 309.9965, "0x000000", 0);
tubo2 = PP.shapes.rectangle_add(s, 990, 991, 239, 693, "0x000000", 0);
tubo3 = PP.shapes.rectangle_add(s, 1308, 1032, 395, 85, "0x000000", 0);
tubo4 = PP.shapes.rectangle_add(s, 1018, 1425, 1267, 175, "0x000000", 0);
tubo5 = PP.shapes.rectangle_add(s, 718, 12, 1283, 234, "0x000000", 0);
tubo6 = PP.shapes.rectangle_add(s, 1266, 218, 186, 177, "0x000000", 0);
tubo7 = PP.shapes.rectangle_add(s, 1593, 242, 468, 131, "0x000000", 0);
tubo8 = PP.shapes.rectangle_add(s, 1891, 61, 126, 1123, "0x000000", 0);
tubo9 = PP.shapes.rectangle_add(s, 1455, -402, 744, 195, "0x000000", 0);
tubo10 = PP.shapes.rectangle_add(s, 2076, -13, 243, 60, "0x000000", 0);
tubo11 = PP.shapes.rectangle_add(s, 2545, 292, 877, 131, "0x000000", 0);
tubo12 = PP.shapes.rectangle_add(s, 2586, 872, 1678, 143, "0x000000", 0);
tubo13 = PP.shapes.rectangle_add(s, 2965, 599, 335, 124, "0x000000", 0);
tubo14 = PP.shapes.rectangle_add(s, 3279, -27, 292, 1656, "0x000000", 0);
tubo15 = PP.shapes.rectangle_add(s, 3606, 599, 361, 124, "0x000000", 0);
tubo16 = PP.shapes.rectangle_add(s, 2731, -234, 803, 179, "0x000000", 0);
tubo17 = PP.shapes.rectangle_add(s, 3816, -431, 782, 110, "0x000000", 0);
tubo18 = PP.shapes.rectangle_add(s, 4289, -534, 163, 315, "0x000000", 0);
tubo19 = PP.shapes.rectangle_add(s, 2822, 1255, 1988, 164, "0x000000", 0);
tubo20 = PP.shapes.rectangle_add(s, 3650, 1486, 332, 297, "0x000000", 0);
tubo21 = PP.shapes.rectangle_add(s, 4342, 1574, 1051, 122, "0x000000", 0);
tubo22 = PP.shapes.rectangle_add(s, 4526, 1100, 110, 310, "0x000000", 0);
tubo23 = PP.shapes.rectangle_add(s, 4217, 887, 1209, 114, "0x000000", 0);
tubo24 = PP.shapes.rectangle_add(s, 4941, 691, 238, 505, "0x000000", 0);
tubo25 = PP.shapes.rectangle_add(s, 4547, 307, 1026, 262, "0x000000", 0);
tubo26 = PP.shapes.rectangle_add(s, 5360, -179, 1556, 117, "0x000000", 0);
tubo27 = PP.shapes.rectangle_add(s, 5481, -407, 400, 337, "0x000000", 0);
tubo28 = PP.shapes.rectangle_add(s, 5849, -514, 336, 121, "0x000000", 0);



Expand Down

0 comments on commit 1edfc10

Please sign in to comment.