Skip to content

Commit

Permalink
first Fix to Game
Browse files Browse the repository at this point in the history
only 4 player now available.
  • Loading branch information
DanielJTodd committed May 21, 2013
1 parent 41e71a4 commit 6a8d845
Show file tree
Hide file tree
Showing 45 changed files with 474 additions and 231 deletions.
Binary file added bin/NumBlitx.apk
Binary file not shown.
Binary file added bin/classes.dex
Binary file not shown.
Binary file modified bin/classes/app/dj/BlitzAI$1.class
Binary file not shown.
Binary file modified bin/classes/app/dj/BlitzAI.class
Binary file not shown.
Binary file added bin/classes/app/dj/Colorchooser$1.class
Binary file not shown.
Binary file modified bin/classes/app/dj/Colorchooser.class
Binary file not shown.
Binary file modified bin/classes/app/dj/Deck$Card.class
Binary file not shown.
Binary file modified bin/classes/app/dj/Deck.class
Binary file not shown.
Binary file modified bin/classes/app/dj/Game$1.class
Binary file not shown.
Binary file modified bin/classes/app/dj/Game$2.class
Binary file not shown.
Binary file modified bin/classes/app/dj/Game.class
Binary file not shown.
Binary file modified bin/classes/app/dj/GameStats.class
Binary file not shown.
Binary file added bin/classes/app/dj/MainActivity$1.class
Binary file not shown.
Binary file modified bin/classes/app/dj/MainActivity.class
Binary file not shown.
Binary file modified bin/classes/app/dj/NumPlayer.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$array.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$attr.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$dimen.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$drawable.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$id.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$layout.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$string.class
Binary file not shown.
Binary file added bin/classes/app/dj/R$style.class
Binary file not shown.
Binary file added bin/classes/app/dj/R.class
Binary file not shown.
Binary file not shown.
Binary file added bin/res/drawable-hdpi/ic_bydj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-hdpi/splash_bydj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-ldpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/res/drawable-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/resources.ap_
Binary file not shown.
159 changes: 159 additions & 0 deletions gen/app/dj/R.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/

package app.dj;

public final class R {
public static final class array {
public static final int numberplayers=0x7f050000;
}
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f070000;
public static final int activity_vertical_margin=0x7f070001;
}
public static final class drawable {
public static final int ic_bydj=0x7f020000;
public static final int ic_launcher=0x7f020001;
public static final int splash_bydj=0x7f020002;
}
public static final class id {
public static final int LLtvadds=0x7f06002d;
public static final int b200=0x7f060008;
public static final int b201=0x7f060009;
public static final int b202=0x7f06000a;
public static final int b203=0x7f06000b;
public static final int b210=0x7f06000c;
public static final int b211=0x7f06000d;
public static final int b212=0x7f06000e;
public static final int b213=0x7f06000f;
public static final int b300=0x7f060011;
public static final int b301=0x7f060012;
public static final int b302=0x7f060013;
public static final int b303=0x7f060014;
public static final int b310=0x7f060015;
public static final int b311=0x7f060016;
public static final int b312=0x7f060017;
public static final int b313=0x7f060018;
public static final int b320=0x7f060019;
public static final int b321=0x7f06001a;
public static final int b322=0x7f06001b;
public static final int b323=0x7f06001c;
public static final int b400=0x7f06001e;
public static final int b401=0x7f06001f;
public static final int b402=0x7f060020;
public static final int b403=0x7f060021;
public static final int b404=0x7f060022;
public static final int b410=0x7f060023;
public static final int b411=0x7f060024;
public static final int b412=0x7f060025;
public static final int b413=0x7f060026;
public static final int b414=0x7f060027;
public static final int b420=0x7f060028;
public static final int b421=0x7f060029;
public static final int b422=0x7f06002a;
public static final int b423=0x7f06002b;
public static final int b424=0x7f06002c;
public static final int bRULZ=0x7f060044;
public static final int bbrick0=0x7f060032;
public static final int bbrick1=0x7f060033;
public static final int bbrick2=0x7f060034;
public static final int bdone=0x7f06003e;
public static final int bgreen=0x7f060006;
public static final int blongp=0x7f060035;
public static final int bmulti=0x7f060042;
public static final int borange=0x7f060005;
public static final int bplay2=0x7f06004f;
public static final int bplay3=0x7f06004d;
public static final int bplayer4=0x7f06004b;
public static final int bplayerlvl=0x7f060049;
public static final int bpurple=0x7f060004;
public static final int bshortp=0x7f060037;
public static final int bsingle=0x7f060045;
public static final int bstart1=0x7f060041;
public static final int bstart2=0x7f060046;
public static final int bstuck=0x7f060036;
public static final int byellow=0x7f060003;
public static final int color=0x7f060000;
public static final int coloradview=0x7f060001;
public static final int fillspace3=0x7f060048;
public static final int lplayerpiles=0x7f060031;
public static final int main=0x7f060040;
public static final int mainadspace=0x7f060043;
public static final int number=0x7f060047;
public static final int numplayeraddspace=0x7f06004e;
public static final int play3=0x7f060010;
public static final int player2=0x7f060007;
public static final int player4=0x7f06001d;
public static final int sliderPLRLVL=0x7f060051;
public static final int splashscreen=0x7f060050;
public static final int statbottom=0x7f06003d;
public static final int textView2=0x7f06004a;
public static final int tvPLRLVL=0x7f060052;
public static final int tvchose=0x7f060002;
public static final int tvgamebrick=0x7f06002e;
public static final int tvgamelong=0x7f06002f;
public static final int tvgameshort=0x7f060030;
public static final int tvnumplayers=0x7f06004c;
public static final int tvplayer0=0x7f060038;
public static final int tvplayer1=0x7f060039;
public static final int tvplayer2=0x7f06003a;
public static final int tvplayer3=0x7f06003b;
public static final int tvwin=0x7f06003c;
public static final int tvyou=0x7f06003f;
}
public static final class layout {
public static final int chatroom=0x7f030000;
public static final int colorchose=0x7f030001;
public static final int game=0x7f030002;
public static final int gamestats=0x7f030003;
public static final int main=0x7f030004;
public static final int multymain=0x7f030005;
public static final int numbplayers=0x7f030006;
public static final int search=0x7f030007;
public static final int splash=0x7f030008;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f080000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f080001;
}
}
Binary file removed res/drawable-320dpi/ic_launcher.png
Binary file not shown.
17 changes: 16 additions & 1 deletion res/layout-land/colorchose.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/color" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:id="@id/coloradview" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<LinearLayout android:orientation="vertical" android:id="@id/coloradview" android:layout_width="fill_parent" android:layout_height="wrap_content" >

<SeekBar
android:id="@+id/sliderPLRLVL"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</LinearLayout>

<TextView
android:id="@+id/tvPLRLVL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Player Lvl: 1"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView android:textAppearance="?android:textAppearanceLarge" android:gravity="center" android:id="@id/tvchose" android:layout_width="fill_parent" android:layout_height="0.0dip" android:text="Choose a Team" android:layout_weight="75.0" />
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="25.0">
<Button android:id="@id/byellow" android:layout_width="0.0dip" android:layout_height="fill_parent" android:text="Yellow" android:layout_weight="25.0" />
Expand Down
16 changes: 0 additions & 16 deletions res/layout/activity_main.xml

This file was deleted.

9 changes: 0 additions & 9 deletions res/menu/main.xml

This file was deleted.

27 changes: 20 additions & 7 deletions src/app/dj/BlitzAI.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package app.dj;

import android.widget.Button;
import java.util.Random;

public class BlitzAI implements Runnable {
Expand All @@ -24,6 +23,9 @@ public BlitzAI(Player paramPlayer, Gamepiles[][] paramArrayOfGamepiles,
}

private boolean checkBricks() {
if(gameover){
return false;
}
int i = 0;
while (i < 3) {
if (!checkPiles(this.thisp.getbrick(i).getCard())) {
Expand All @@ -43,6 +45,9 @@ private boolean checkBricks() {
}

private boolean checkLong() {
if(gameover){
return false;
}
int i;
if (!checkPiles(this.thisp.getlong().peektopcard())) {
this.thisp.getlong().slide();
Expand All @@ -55,6 +60,9 @@ private boolean checkLong() {
}

private boolean checkPiles(Deck.Card paramCard) {
if(gameover){
return false;
}
int k = 1;
int j = 0;
while (true) {
Expand All @@ -71,13 +79,15 @@ private boolean checkPiles(Deck.Card paramCard) {
}
this.piles[j][i].add(paramCard);
play(j, i, paramCard);
break;
return k==1;
}
j++;
continue;
}
k = 0;
break;
}
return k==1;
}

private boolean checkShort() {
Expand All @@ -92,11 +102,14 @@ private boolean checkShort() {
return i == 1;
}

private void play(final int i, final int j, final Deck.Card c) {
private synchronized void play(final int i, final int j, final Deck.Card c) {
if(gameover){
return;
}
this.slides = 0;
this.game.getButtonMap()[i][j].post(new Runnable() {
public void run() {
BlitzAI.this.game.getButtonMap()[i][j].setText(c.getvalue());
BlitzAI.this.game.getButtonMap()[i][j].setText(Integer.toString(c.getvalue()));
BlitzAI.this.game.getButtonMap()[i][j].setBackgroundColor(Game
.myColor(c.getsuit()));
BlitzAI.this.gameover = Boolean.valueOf(BlitzAI.this.thisp
Expand All @@ -108,7 +121,7 @@ public void run() {
}
});
try {
Thread.sleep(1000 * (1 + new Random().nextInt(this.lvl)));
Thread.sleep(1000 * this.lvl);
return;
} catch (InterruptedException localInterruptedException) {
while (true)
Expand Down Expand Up @@ -156,11 +169,11 @@ public void pause() {
}

public void run() {
while (true) {
while (!this.gameover.booleanValue()) {
if (this.gameover.booleanValue())
return;
try {
Thread.sleep(1000 * (1 + new Random().nextInt(this.lvl)));
Thread.sleep(1000 * this.lvl);
if (checkShort())
this.thisp.scorepp();

Expand Down
Loading

0 comments on commit 6a8d845

Please sign in to comment.