Skip to content
Snippets Groups Projects
Commit 9106820f authored by Ethan Liang's avatar Ethan Liang
Browse files

error free sfx chalk dodge (for now)

parent 5c9c6f54
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,8 @@ public class ChalkGameClass extends View {
private Bitmap backgroundImage ;
//MEDIA
// 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];
......@@ -116,9 +117,6 @@ 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);
if (backgroundImage == null) return;
// Use the same Matrix over and over again to minimize
// allocation in onDraw.
......@@ -147,7 +145,7 @@ public class ChalkGameClass extends View {
if(normGravity)
{
playerSpeed = 125;
// bonk.start();
bonk.start();
}
} //limiting the player's y to the top of the screen
......@@ -179,7 +177,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();
oof.start();
lifecounter--; //reduces health;
if(lifecounter == 0) //if all lives used up
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment