Loading app/src/main/java/com/example/game2d/ChalkGameClass.java +8 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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]; Loading Loading @@ -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(); Loading Loading @@ -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); Loading @@ -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); Loading Loading @@ -308,4 +315,5 @@ public class ChalkGameClass extends View { return false; } } app/src/main/java/com/example/game2d/ChalkGameRIPActivity.java +6 −0 Original line number Diff line number Diff line Loading @@ -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); Loading app/src/main/java/com/example/game2d/ChalkResultActivity.java +8 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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") Loading @@ -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, Loading @@ -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); Loading @@ -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); Loading app/src/main/java/com/example/game2d/ChalkToQuizActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading app/src/main/res/raw/aramid.mp3 0 → 100644 +3.69 MiB File added.No diff preview for this file type. View file Loading
app/src/main/java/com/example/game2d/ChalkGameClass.java +8 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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]; Loading Loading @@ -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(); Loading Loading @@ -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); Loading @@ -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); Loading Loading @@ -308,4 +315,5 @@ public class ChalkGameClass extends View { return false; } }
app/src/main/java/com/example/game2d/ChalkGameRIPActivity.java +6 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
app/src/main/java/com/example/game2d/ChalkResultActivity.java +8 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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") Loading @@ -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, Loading @@ -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); Loading @@ -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); Loading
app/src/main/java/com/example/game2d/ChalkToQuizActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading
app/src/main/res/raw/aramid.mp3 0 → 100644 +3.69 MiB File added.No diff preview for this file type. View file