Skip to content

Commit

Permalink
Merge master to how to play screen
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal1201 committed May 28, 2022
1 parent 88c07fa commit b1cbf88
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.ImageButton;
Expand Down Expand Up @@ -37,6 +38,9 @@ protected void onCreate(Bundle savedInstanceState) {
animationBackground.setExitFadeDuration(5000);
animationBackground.start();

scaleUp= AnimationUtils.loadAnimation(this, R.anim.scale_up);
scaleDown= AnimationUtils.loadAnimation(this, R.anim.scale_down);

escapeHash = findViewById(R.id.controlChoice_escapeHash);
escapeHash.setOnClickListener(view -> goBack());

Expand Down Expand Up @@ -66,6 +70,8 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean raceModeIsON
* Method for the escape Hash that launches MainActivity
*/
private void goBack() {
escapeHash.startAnimation(scaleUp);
escapeHash.startAnimation(scaleDown);
Intent goToMain = new Intent(this, MainActivity.class);
startActivity(goToMain);
}
Expand All @@ -78,6 +84,8 @@ public void openButtonControl() {
if(isOnRaceMode){
buttonControlIntent.putExtra("RaceMode", "Race Mode is on" );
}
controlPad.startAnimation(scaleUp);
controlPad.startAnimation(scaleDown);
startActivity(buttonControlIntent);
}
/**
Expand All @@ -88,6 +96,8 @@ public void openJoystick() {
if(isOnRaceMode){
joystickIntent.putExtra("RaceMode", "Race Mode is on");
}
joystick.startAnimation(scaleUp);
joystick.startAnimation(scaleDown);
startActivity(joystickIntent);
}

Expand Down

0 comments on commit b1cbf88

Please sign in to comment.