-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameActivity.java
More file actions
53 lines (48 loc) · 1.77 KB
/
Copy pathGameActivity.java
File metadata and controls
53 lines (48 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.example.itay.sumika;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;
public class GameActivity extends AppCompatActivity{
GameScreen gameScreen;
GridView gridView;
ImageView circleTurn;
TextView timeTv, announceTv;
int numOfHorizontal,numOfVertical, spacingCounter;
boolean isOnePlayer;
int compLevel,validSpace,timeForMove;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game);
initializeVariables();
gameScreen= new GameScreen(numOfHorizontal,
numOfVertical,
gridView,
circleTurn,
timeTv,
announceTv,
getApplicationContext(),
compLevel,
isOnePlayer,
validSpace,
timeForMove);
}
public void initializeVariables(){
circleTurn=findViewById(R.id.circleWhosTurnIsIt);
gridView=findViewById(R.id.gridView);
timeTv=findViewById(R.id.timeTv);
announceTv=findViewById(R.id.announceTv);
getExtras();
}
public void getExtras(){
numOfHorizontal=getIntent().getExtras().getInt("numOfSqure");
numOfVertical=getIntent().getExtras().getInt("numOfSqure");
isOnePlayer=getIntent().getExtras().getBoolean("onePlayer");
compLevel=getIntent().getExtras().getInt("compLevel");
validSpace=getIntent().getExtras().getInt("validSpace");
timeForMove=getIntent().getExtras().getInt("timeForMove");
spacingCounter=getIntent().getExtras().getInt("spacingCounter");
}
}