Commit e38c8f2f authored by Ethan Liang's avatar Ethan Liang
Browse files

chalk dodge mediaplyer fixes ??

parent cfef98f8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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();
+5 −3
Original line number Diff line number Diff line
@@ -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];
@@ -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