Can the community code flappy bird?

curtis

Dedicated Member
curtis18264
curtis18264
Joined
Oct 19, 2019
Posts
180
Ratings
121 2
#1
Seasons greetings, all.

This thread is all about cooperating to achieve the ultimate goal of making a fully functional flappy bird clone. This will be written in javascript, however, if you would like to write in java instead, I can translate that to javascript for you.

Each person who comments can add one line of code at a time, and must wait until someone else takes their turn before going again. Thats the main idea.

The Rules:

- You can only comment one line of code at a time

- Wait until someone else takes their turn before going again

- You may include opening curly brackets or closing curly brackets on your line
ex: line 1 : for(let i = 0; i < 5; i++){ //this is legal
line 2: console.log("e");} //this is also legal
//this rule is in place so the next person doesn't have to waste their comment on a curly bracket

- Code like you would normally. Don't put several things on one line just because you can
ex: for(let i = 0; i < 5; i++){ console.log("e"); console.log(4); } //this is illegal and gross

- You can remove or comment out a line, but don't do this to mess things up

- You can add as many comments as you like on any line, but don't abuse this

- You can discuss what to do, but you can not write direct lines of code for someone else to copy and paste into a comment
ex: "we should make a for loop here" //legal
"Can the next person add this code: console.log(4);" //illegal :mad:


How to Participate:

Just comment your line and where it should go. You can remove lines, comment out lines, insert lines, or replace lines. I will update this every time I visit the website.


What Functions & Variables are Given:

let upArrow = false; //Assume this variable is true when the up arrow is pressed, and vice versa

const screenWidth = 400; //Width of screen. Can't be changed

const screenHeight = 400; //Height of screen. No changing!

drawR(x, y, width, height, color); //This draws a rectangle. The color parameter should be given a string in the hex format: "#FFFFFF"
//ex: drawR(10, 50, 5, 5, "#FF55F6");


clearScreen(); //Erases anything that has been drawn on the screen

draw(){ /*Put code here*/ } //Assume this function runs 30 times every second. You can put code inside of it.

Please note that the y-axis is flipped, meaning at the top of the screen, y = 0, and at the bottom, y = 400
If there is any essential functions I left out, please let me know. Below is the entire program

1 : let playerX = 40, playerY = 200; //coordinates of player
2 : draw();
3 :
4 :
5 :
6 : function draw(){
7 :
8 :
9 :
10: }
 

curtis

Dedicated Member
curtis18264
curtis18264
Joined
Oct 19, 2019
Posts
180
Ratings
121 2
#2
I will go first

Insert at line 1
let playerX = 40, playerY = 200; //coordinates of the player