Commit 63c9b2bf authored by Ankita Tiwari's avatar Ankita Tiwari
Browse files

Merge remote-tracking branch 'origin/top-secret' into top-secret

parents 8adcaf9a f39fcc25
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList
        // BGM
        backgroundMusic = MediaPlayer.create(this,R.raw.tanpopo);
        backgroundMusic.setLooping(true);
        backgroundMusic.start();

        //for pop up intro
        layout = findViewById(R.id.chalkActivity); // relative is the id of the layout of the page
@@ -209,11 +208,15 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList
                .show();*/
    }

    protected void onStart() {
        super.onStart();
        backgroundMusic.start();
    }

    protected void onPause() {
        super.onPause();
        backgroundMusic.stop();
        backgroundMusic.pause();
    }

    /*void restartQuiz(){
        chalkscore = 0;
        currentQuestionIndex = 0;
+3 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ public class ChalkGameClass extends View {
    private Bitmap backgroundImage ;

    //MEDIA
    MediaPlayer bonk;
    MediaPlayer bonk, oof;

    //CHALK
    private Bitmap chalk[] = new Bitmap[5];
@@ -102,6 +102,7 @@ public class ChalkGameClass extends View {
        canvasHeight = canvas.getHeight();

        bonk = MediaPlayer.create(getContext(), R.raw.bonk);
        oof = MediaPlayer.create(getContext(), R.raw.oof);

        if (backgroundImage == null) return;
        // Use the same Matrix over and over again to minimize
@@ -160,6 +161,7 @@ public class ChalkGameClass extends View {
            if (hitChalkChecker(chalkX[ii], chalkY[ii])) //if player collides with chalk
            {
                chalkX[ii] = chalkX[ii] - 200; //makes chalk disappear
                oof.start();
                lifecounter--; //reduces health;

                if(lifecounter == 0)  //if all lives used up
+5 −3
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ public class FirebaseActivity extends AppCompatActivity {
    TextView nameScore, chalkScore;

    //public Map<String, Object> userScoreMap;
    public Map<String, Long> big_userScoreMap = new HashMap<>();
    //public Map<String, Long> big_userScoreMap = new HashMap<>();
    Scoreboard big_userScoreMap = new Scoreboard();

    int bestChalk;
    float percent;
@@ -154,13 +155,14 @@ public class FirebaseActivity extends AppCompatActivity {
                                    if (scoreObj instanceof Long) { //if it's the score_value
                                        score = (Long) scoreObj;
                                        //big_userScoreMap.put(document.getId(),score);
                                        Log.d(TAG,"BIG size : "+ big_userScoreMap.size());
                                        //Log.d(TAG,"BIG size : "+ big_userScoreMap.size());
                                        //Log.d(TAG, "User: " + user + ", Score: " + score);
                                    }
                                    else { //else it's the username
                                        Log.d(TAG,"the username: "+scoreObj.toString());
                                    }
                                    big_userScoreMap.put(scoreObj.toString(),score); // add <username,score> into the big
                                    big_userScoreMap.add(scoreObj.toString(),score); // add <username,score> into the big

                                }
                            }
                        } else {
+3 −1
Original line number Diff line number Diff line
package com.example.game2d;

import static com.example.game2d.MapUtil.sortByValue;
//import static com.example.game2d.FirebaseActivity.;

import android.annotation.SuppressLint;
import android.graphics.Typeface;
@@ -21,6 +22,7 @@ import java.util.Vector;

public class LeaderboardActivity extends AppCompatActivity {

    //big_userScoreData
    private LinearLayout scoreListLayout;

    @SuppressLint("DefaultLocale")
@@ -30,7 +32,7 @@ public class LeaderboardActivity extends AppCompatActivity {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_leaderboard);

        Typeface customFont = Typeface.createFromAsset(getAssets(), "custom_font.ttf");
        //Typeface customFont = Typeface.createFromAsset(getAssets(), "custom_font.ttf");

        // Get reference to the LinearLayout that will hold the scores
        scoreListLayout = findViewById(R.id.score_list_layout);
+6 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ public class MainActivity extends AppCompatActivity {

        backgroundMusic = MediaPlayer.create( this, R.raw.moog_city_two );
        backgroundMusic.setLooping(true);
        backgroundMusic.start();

        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
@@ -43,10 +42,13 @@ public class MainActivity extends AppCompatActivity {
        setContentView(new Game(this));
    }

    protected void onStart() {
        super.onStart();
        backgroundMusic.start();
    }

    protected void onPause() {
        super.onPause();
        backgroundMusic.stop();
        backgroundMusic.pause();
    }


}
 No newline at end of file
Loading