Commit db3cddbd authored by Ankita Tiwari's avatar Ankita Tiwari
Browse files

Added ChalkRIP page

parent e0faee4e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -12,13 +12,16 @@
        android:theme="@style/Theme.Game2D"
        tools:targetApi="31">
        <activity
            android:name=".ChalkToQuizActivity"
            android:screenOrientation="landscape"
            android:name=".ChalkGameRIPActivity"
            android:exported="false" />
        <activity
            android:name=".ChalkToQuizActivity"
            android:exported="false"
            android:screenOrientation="landscape" />
        <activity
            android:name=".QuizToChalkActivity"
            android:screenOrientation="landscape"
            android:exported="false" />
            android:exported="false"
            android:screenOrientation="landscape" />
        <activity
            android:name=".ChalkIntroActivity"
            android:exported="false"
+5 −5
Original line number Diff line number Diff line
@@ -59,8 +59,8 @@ public class ChalkGameClass extends View {
    {
        super(context);

        //ranGravity = (int) Math.floor(Math.random() * 5) + 1; //ranGravity is a random integer between 1 and 5
        ranGravity = 2;
        ranGravity = (int) Math.floor(Math.random() * 5) + 1; //ranGravity is a random integer between 1 and 5


        if(ranGravity%2 ==1)
            normGravity = true; //if ranGravity is odd, normal gravity is used where you jump up but rest at the bottom
@@ -178,9 +178,9 @@ public class ChalkGameClass extends View {

                if(lifecounter == 0)  //if all lives used up
                {
                    Intent mainIntent = new Intent(getContext(), MainActivity.class);
                    mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    getContext().startActivity(mainIntent);
                    Intent RIPIntent = new Intent(getContext(), ChalkGameRIPActivity.class);
                    RIPIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    getContext().startActivity(RIPIntent);

                }
            }
+26 −0
Original line number Diff line number Diff line
package com.example.game2d;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class ChalkGameRIPActivity extends AppCompatActivity {
    private Button resButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chalk_game_ripactivity);
        resButton = findViewById(R.id.ChalkRIPResume);
        resButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent ChalkRIPtrns = new Intent(ChalkGameRIPActivity.this,ChalkGameActivity.class);
                ChalkRIPtrns.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                startActivity(ChalkRIPtrns);
            }
        });
    }
}
 No newline at end of file
+65 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ChalkGameRIPActivity"
    android:background="#D6D6D6">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="30dp"
        android:orientation="vertical"
        android:gravity="center"
        android:background="@drawable/popupbg">

        <TextView
            style="@android:style/TextAppearance.DeviceDefault.Medium"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="10dp"
            android:text="Le GASP!"
            android:textColor="@color/black"
            android:textSize="24sp"
            android:fontFamily="@font/alfa_slab_one" />

        <TextView
            android:id="@+id/textView3"
            style="@android:style/TextAppearance.DeviceDefault.Medium"
            android:layout_width="match_parent"

            android:layout_height="wrap_content"
            android:gravity="left"

            android:layout_marginStart="20dp"
            android:layout_marginTop="20dp"
            android:layout_marginEnd="20dp"
            android:text="The chalk annihilated you!!!"
            android:textColor="@color/black"
            android:textSize="20sp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:layout_marginTop="10dp"
            android:layout_marginEnd="20dp"

            android:text="Luckily, our scientists have found a way to respawn you to the main menu!"
            android:textSize="18sp" />

        <Button
            android:id="@+id/ChalkRIPResume"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:layout_marginTop="30dp"
            android:layout_marginEnd="20dp"
            android:text="Continue"
            android:fontFamily="@font/abeezee" />

    </LinearLayout>


</RelativeLayout>
 No newline at end of file