Commit 13f7ae8f authored by Ankita Tiwari's avatar Ankita Tiwari
Browse files

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

parents 96cb049e 3a5aa221
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.media.MediaPlayer;
import android.provider.MediaStore;
import android.view.MotionEvent;
import android.view.View;

@@ -34,6 +35,7 @@ public class ChalkGameClass extends View {
    //MEDIA
    MediaPlayer bonk = MediaPlayer.create(getContext(), R.raw.bonk);
    MediaPlayer oof = MediaPlayer.create(getContext(), R.raw.oof);
    MediaPlayer bossMusic = MediaPlayer.create(getContext(), R.raw.aramid);

    //CHALK
    private Bitmap chalk[] = new Bitmap[5];
@@ -125,6 +127,9 @@ public class ChalkGameClass extends View {
        // Use the same Matrix over and over again to minimize
        // allocation in onDraw.

        // boss music start
        bossMusic.start();

        //getting the question index

        Matrix matrix = new Matrix();
@@ -186,6 +191,7 @@ public class ChalkGameClass extends View {

                if(lifecounter == 0)  //if all lives used up
                {
                    bossMusic.stop();
                    Intent RIPIntent = new Intent(getContext(), ChalkGameRIPActivity.class);
                    RIPIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    getContext().startActivity(RIPIntent);
@@ -208,6 +214,7 @@ public class ChalkGameClass extends View {
            {
                chalkX[ii] = chalkX[ii] - 200;
                chalkPassed = 0;
                bossMusic.stop();
                Intent returnQuiz = new Intent(getContext(), ChalkToQuizActivity.class);
                returnQuiz.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                getContext().startActivity(returnQuiz);
@@ -308,4 +315,5 @@ public class ChalkGameClass extends View {

        return false;
    }

}
+6 −0
Original line number Diff line number Diff line
@@ -3,20 +3,26 @@ package com.example.game2d;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class ChalkGameRIPActivity extends AppCompatActivity {
    private Button resButton;

    MediaPlayer ripSound = MediaPlayer.create(getApplicationContext(), R.raw.gta_wasted);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ripSound.start();
        setContentView(R.layout.activity_chalk_game_ripactivity);
        resButton = findViewById(R.id.ChalkRIPResume);
        resButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ripSound.stop();
                Intent ChalkRIPtrns = new Intent(ChalkGameRIPActivity.this,MainActivity.class);
                ChalkRIPtrns.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_CLEAR_TASK);
                startActivity(ChalkRIPtrns);
+8 −1
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@ package com.example.game2d;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@@ -23,6 +25,8 @@ public class ChalkResultActivity extends AppCompatActivity { //
    int lastChalkScore;
    int bestChalk;

MediaPlayer winSound = MediaPlayer.create(getApplicationContext(), R.raw.eerie_win);

    Button submitBtn;

    @SuppressLint("SetTextI18n")
@@ -30,7 +34,8 @@ public class ChalkResultActivity extends AppCompatActivity { //
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_name_result);

        winSound.start();
        Log.d("CHALKRESULT", "onCreate after sound start");
        Window window = getWindow();
        window.setFlags(
                WindowManager.LayoutParams.FLAG_FULLSCREEN,
@@ -47,6 +52,7 @@ public class ChalkResultActivity extends AppCompatActivity { //
        back_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                winSound.stop();
                // switch back to main activity
                Intent intent = new Intent(ChalkResultActivity.this, MainActivity.class);
                startActivity(intent);
@@ -59,6 +65,7 @@ public class ChalkResultActivity extends AppCompatActivity { //
        again_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                winSound.stop();
                // switch back to main activity
                Intent intent = new Intent(ChalkResultActivity.this, ChalkActivity.class);
                startActivity(intent);
+4 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package com.example.game2d;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@@ -10,16 +11,19 @@ import android.widget.Button;
public class ChalkToQuizActivity extends AppCompatActivity {
    private Button resButton;

    MediaPlayer victorySound = MediaPlayer.create(getApplicationContext(), R.raw.valorant_ace);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        victorySound.start();
        setContentView(R.layout.activity_chalk_to_quiz);
        resButton = findViewById(R.id.ChalktoQuizResume);

        resButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                victorySound.stop();
                Intent Quiztrns = new Intent(ChalkToQuizActivity.this,ChalkActivity.class);
                Quiztrns.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                startActivity(Quiztrns);
+3.69 MiB

File added.

No diff preview for this file type.

Loading