Loading app/src/main/java/com/example/game2d/ChalkActivity.java +0 −2 Original line number Diff line number Diff line Loading @@ -134,12 +134,10 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList Button clickedButton = (Button) view; if(clickedButton.getId()==R.id.submit_btn){ if(selectedAnswer == "") { Toast.makeText(getApplicationContext(),"none", Toast.LENGTH_SHORT).show(); new AlertDialog.Builder(this) .setMessage("Please select an answer") .show(); } else if(selectedAnswer.equals(ChalkQuestionAnswer.correctAnswers[currentQuestionIndex])){ Toast.makeText(getApplicationContext(),"correct", Toast.LENGTH_SHORT).show(); //SFX MediaPlayer correctSound = MediaPlayer.create(this, R.raw.correct); correctSound.start(); Loading app/src/main/java/com/example/game2d/ChalkGameClass.java +5 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ public class ChalkGameClass extends View { private Bitmap backgroundImage ; //MEDIA MediaPlayer bonk, oof; /* MediaPlayer bonk, oof;*/ MediaPlayer bonk = MediaPlayer.create(getContext(), R.raw.bonk); MediaPlayer oof = MediaPlayer.create(getContext(), R.raw.oof); //CHALK private Bitmap chalk[] = new Bitmap[5]; Loading Loading @@ -113,8 +115,8 @@ public class ChalkGameClass extends View { canvasWidth = canvas.getWidth(); canvasHeight = canvas.getHeight(); bonk = MediaPlayer.create(getContext(), R.raw.bonk); oof = MediaPlayer.create(getContext(), R.raw.oof); /*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 Loading Loading
app/src/main/java/com/example/game2d/ChalkActivity.java +0 −2 Original line number Diff line number Diff line Loading @@ -134,12 +134,10 @@ public class ChalkActivity extends AppCompatActivity implements View.OnClickList Button clickedButton = (Button) view; if(clickedButton.getId()==R.id.submit_btn){ if(selectedAnswer == "") { Toast.makeText(getApplicationContext(),"none", Toast.LENGTH_SHORT).show(); new AlertDialog.Builder(this) .setMessage("Please select an answer") .show(); } else if(selectedAnswer.equals(ChalkQuestionAnswer.correctAnswers[currentQuestionIndex])){ Toast.makeText(getApplicationContext(),"correct", Toast.LENGTH_SHORT).show(); //SFX MediaPlayer correctSound = MediaPlayer.create(this, R.raw.correct); correctSound.start(); Loading
app/src/main/java/com/example/game2d/ChalkGameClass.java +5 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ public class ChalkGameClass extends View { private Bitmap backgroundImage ; //MEDIA MediaPlayer bonk, oof; /* MediaPlayer bonk, oof;*/ MediaPlayer bonk = MediaPlayer.create(getContext(), R.raw.bonk); MediaPlayer oof = MediaPlayer.create(getContext(), R.raw.oof); //CHALK private Bitmap chalk[] = new Bitmap[5]; Loading Loading @@ -113,8 +115,8 @@ public class ChalkGameClass extends View { canvasWidth = canvas.getWidth(); canvasHeight = canvas.getHeight(); bonk = MediaPlayer.create(getContext(), R.raw.bonk); oof = MediaPlayer.create(getContext(), R.raw.oof); /*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 Loading