Skip to content

Commit

Permalink
Fix column dropping and "Snood 21" -> "Snooder 21"
Browse files Browse the repository at this point in the history
Massive update data
Fix sprite which added to column
  • Loading branch information
EXL committed Aug 1, 2016
1 parent 60a63e5 commit 06b20d2
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,3 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties

# Data files
cover.png
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioButton;
//import android.widget.RadioButton;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
Expand Down Expand Up @@ -73,8 +73,8 @@ public static class SnoodsSettings {
private SeekBar animationSpeedSeekBar = null;
private TextView animationSpeedTextView = null;

private RadioButton motoRadioButton = null;
private RadioButton paperRadioButton = null;
// private RadioButton motoRadioButton = null;
// private RadioButton paperRadioButton = null;

public static SharedPreferences settingStorage = null;

Expand All @@ -91,11 +91,11 @@ public void fillSettingsByLayout() {
SnoodsSettings.showFps = showFpsCheckBox.isChecked();
SnoodsSettings.writeScores = writeHighScoresCheckBox.isChecked();

if (motoRadioButton.isChecked()) {
SnoodsSettings.themeId = THEME_MOTO;
} else if (paperRadioButton.isChecked()) {
SnoodsSettings.themeId = THEME_PAPER;
}
// if (motoRadioButton.isChecked()) {
// SnoodsSettings.themeId = THEME_MOTO;
// } else if (paperRadioButton.isChecked()) {
// SnoodsSettings.themeId = THEME_PAPER;
// }

SnoodsSettings.playerName = playerNameEditText.getText().toString();

Expand All @@ -109,19 +109,19 @@ public void fillLayoutBySettings() {
showFpsCheckBox.setChecked(SnoodsSettings.showFps);
writeHighScoresCheckBox.setChecked(SnoodsSettings.writeScores);

switch (SnoodsSettings.themeId) {
case THEME_MOTO: {
motoRadioButton.setChecked(true);
break;
}
case THEME_PAPER: {
paperRadioButton.setChecked(true);
break;
}
default: {
break;
}
}
// switch (SnoodsSettings.themeId) {
// case THEME_MOTO: {
// motoRadioButton.setChecked(true);
// break;
// }
// case THEME_PAPER: {
// paperRadioButton.setChecked(true);
// break;
// }
// default: {
// break;
// }
// }

playerNameEditText.setText(SnoodsSettings.playerName);

Expand Down Expand Up @@ -199,8 +199,8 @@ private void initWidgets() {
animationSpeedTextView = (TextView) findViewById(R.id.animationValueView);
animationSpeedSeekBar = (SeekBar) findViewById(R.id.animationBar);

motoRadioButton = (RadioButton) findViewById(R.id.motoThemeRadioButton);
paperRadioButton = (RadioButton) findViewById(R.id.paperThemeRadioButton);
// motoRadioButton = (RadioButton) findViewById(R.id.motoThemeRadioButton);
// paperRadioButton = (RadioButton) findViewById(R.id.paperThemeRadioButton);

playerNamesView = (TextView) findViewById(R.id.player_Names);
playerScoresView = (TextView) findViewById(R.id.player_Scores);
Expand Down
14 changes: 12 additions & 2 deletions snood21/src/main/java/ru/exlmoto/snood21/SnoodsSurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class SnoodsSurfaceView extends SurfaceView
private Context mContext = null;

private Bitmap mCurrentCardBitmap = null;
private Bitmap mCurrentCardBitmapToDeck = null;
private Bitmap mBackGroundBitmap = null;

private Bitmap mTextAllBitmap = null;
Expand Down Expand Up @@ -105,6 +106,7 @@ public class SnoodsSurfaceView extends SurfaceView
public int secs = 60 * 3;

public boolean mIsDropingColumn = false;
private boolean columnDropped = false;
public boolean[] lockColumns = null;
private int[] columnScores = null;

Expand Down Expand Up @@ -613,6 +615,7 @@ private void switchToNextCard() {
cardIndex--;
if (cardIndex > 0) {
mCurrentCardBitmap = cardBitmaps[mDeck[cardIndex - 1]];
mCurrentCardBitmapToDeck = cardBitmaps[mDeck[cardIndex - 1] + 17];
if (cardIndex > 1) {
mNextCardBitmap = cardBitmaps[mDeck[cardIndex - 2]];
}
Expand All @@ -624,12 +627,14 @@ private void switchToNextCard() {
}

private void addCardToColumn(int column) {
columnDropped = false;
SnoodsLauncherActivity.playSound(SnoodsLauncherActivity.SOUND_DROP);
refreshScores(column);
columnsDecks[column].add(mCurrentCardBitmap);
columnsDecks[column].add(mCurrentCardBitmapToDeck);
}

private void dropColumn(final int column, boolean all) {
columnDropped = true;
mIsDropingColumn = true;
highlightColumn = 0;
columnOffsets[column] += drop_column_speed;
Expand All @@ -654,6 +659,7 @@ public void run() {
if (columnOffsets[column] > ORIGINAL_HEIGHT) {
mPlayingWhooshSound = true;
mIsDropingColumn = false;
columnDropped = false;
animateColumn = true;
if (!all) {
scores += 100 * (column + 1);
Expand Down Expand Up @@ -757,7 +763,10 @@ private void tick() {
}

if (mDeckIsEmpty) {
dropAllColumns();
if (!columnDropped) {
dropAllColumns();
columnDropped = false;
}
if (allColumnsEmpty()) {
if (!mIsGameOver) {
mIsWinAnimation = true;
Expand Down Expand Up @@ -857,6 +866,7 @@ private void resetGame(boolean gameOver) {

private void resetDeckCards() {
mCurrentCardBitmap = cardBitmaps[mDeck[cardIndex - 1]];
mCurrentCardBitmapToDeck = cardBitmaps[mDeck[cardIndex - 1] + 17];
mNextCardBitmap = cardBitmaps[mDeck[cardIndex - 2]];
}

Expand Down
Binary file modified snood21/src/main/res/drawable-nodpi/bkg_moto.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 modified snood21/src/main/res/drawable-nodpi/deck_moto.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 modified snood21/src/main/res/drawable-nodpi/text_moto.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 snood21/src/main/res/drawable-nodpi/win_moto.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed snood21/src/main/res/drawable-nodpi/win_moto.png
Binary file not shown.
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 snood21/src/main/res/drawable/cover.jpg
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 snood21/src/main/res/drawable/icon_about_big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions snood21/src/main/res/layout/activity_snoods_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
android:layout_marginBottom="@dimen/layout_margin"
android:text="@string/run_snood_button" />

<TextView
<!--TextView
android:id="@+id/themeLabel"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="match_parent"
Expand All @@ -49,7 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/theme_paper" />
</RadioGroup>
</RadioGroup-->

<TextView
android:id="@+id/settingsLabel"
Expand Down
3 changes: 2 additions & 1 deletion snood21/src/main/res/layout/dialog_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/iconImageView"
android:contentDescription="@string/icon_desc" />
android:contentDescription="@string/icon_desc"
android:src="@drawable/icon_about_big" />

<TextView
android:layout_width="wrap_content"
Expand Down
Binary file modified snood21/src/main/res/mipmap-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 modified snood21/src/main/res/mipmap-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 modified snood21/src/main/res/mipmap-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 modified snood21/src/main/res/mipmap-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 modified snood21/src/main/res/mipmap-xxxhdpi/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.
8 changes: 4 additions & 4 deletions snood21/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<resources>
<string name="app_name">Snood 21</string>
<string name="run_snood_button">Run Snood 21!</string>
<string name="app_name">Snooder 21</string>
<string name="run_snood_button">Run Snooder 21!</string>
<string name="settings_label">Settings</string>
<string name="vibration_check">Vibration Haptics</string>
<string name="sound_check">Sound</string>
<string name="toasts_check">Show Toasts</string>
<string name="fps_check">Show FPS</string>
<string name="scores_check">Write High Scores to Table</string>
<string name="cover_desc">Snood 21 Cover Image</string>
<string name="cover_desc">Snooder 21 Cover Image</string>
<string name="name_text">Please enter your name:</string>
<string name="hint_text_edit">Enter your name</string>
<string name="player_text_edit">Player</string>
Expand All @@ -23,7 +23,7 @@
<string name="about_string">This is remake</string>
<string name="ok">OK</string>
<string name="help_string">This is help text</string>
<string name="icon_desc">Icon Snood 21</string>
<string name="icon_desc">Icon Snooder 21</string>
<string name="theme_label">Theme</string>
<string name="theme_moto">Moto</string>
<string name="theme_paper">Paper</string>
Expand Down

0 comments on commit 06b20d2

Please sign in to comment.