From 0b66c2c87de9095725ff867a894a4f55b7bc0fe5 Mon Sep 17 00:00:00 2001 From: ShreyashR Date: Mon, 31 Aug 2020 20:41:58 +0530 Subject: [PATCH 1/2] Removed Bugs, made the program faster --- .../Shreyash/Flappy_Birds/Flappy_Birds.pde | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde b/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde index 2a9c19b..0878af0 100644 --- a/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde +++ b/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde @@ -4,10 +4,8 @@ ArrayList log = new ArrayList(); power pow_1; boolean flag=true; - - int bgx; -boolean ch=true,inv=true; +boolean ch=true,inv=true,power=false,t=false; int score=0,total_s=0; void setup(){ size(720,405,P2D); @@ -21,11 +19,24 @@ void setup(){ void draw(){ + //String menu = "Press Space To Start"; + //PFont z= createFont("impact",50); + //textFont(z); + //fill(#FF1212); + //text(menu,150,150); + //if(keyPressed&&key==' ') + //{ + // t=true; + //} if(ch) { - back(); + //if(t) + //{ + back(); player.display(); player.canvas(); + player.gravity(); + String sc="Your Score- "; text(sc,850,50); @@ -66,8 +77,11 @@ void draw(){ textFont(f); fill(0); text(s,600,20); - - while(score>=22){ + if(score==22) + { + power=true; + } + if(power){ PFont end = createFont("impact",30); String ss = "Press B To Activate Invincibility for 15 secs"; fill(0); @@ -77,10 +91,11 @@ void draw(){ { inv=false; score=0; + power=false; } } - } + } else { go = loadImage("./image/go.jpg"); @@ -109,15 +124,12 @@ void draw(){ if(log.size()>6){ log.remove(0); } - if(keyPressed) + if(keyPressed&&key==' ') { - if(key==' ') - { player.assend(); - } } - else - player.gravity(); + + } From 84729620293ffb229c7cf91fd04581ff8f12eabd Mon Sep 17 00:00:00 2001 From: ShreyashR Date: Mon, 31 Aug 2020 20:50:40 +0530 Subject: [PATCH 2/2] Removed Bugs, made the program faster --- .../Shreyash/Flappy_Birds/Flappy_Birds.pde | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde b/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde index 43469c6..c46256b 100644 --- a/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde +++ b/Jo and Astha's team/Shreyash/Flappy_Birds/Flappy_Birds.pde @@ -18,20 +18,9 @@ void setup(){ } void draw(){ - - //String menu = "Press Space To Start"; - //PFont z= createFont("impact",50); - //textFont(z); - //fill(#FF1212); - //text(menu,150,150); - //if(keyPressed&&key==' ') - //{ - // t=true; - //} + if(ch) { - //if(t) - //{ back(); player.display(); player.canvas(); @@ -77,16 +66,14 @@ void draw(){ textFont(f); fill(0); text(s,600,20); -<<<<<<< HEAD + if(score==22) { power=true; } - if(power){ -======= if(score>=22){ ->>>>>>> b157c01fadaed6a42a026eaa2cf4a1a1268d2f57 + PFont end = createFont("impact",30); String ss = "Press B To Activate Invincibility for 15 secs"; fill(0); @@ -134,8 +121,6 @@ void draw(){ player.assend(); } - - } void back(){