package WR.HKZC;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import net.youmi.android.AdManager;
import net.youmi.android.spotad.*;
import com.openfeint.api.OpenFeint;
import com.openfeint.api.OpenFeintDelegate;
import com.openfeint.api.OpenFeintSettings;
import com.openfeint.api.resource.Achievement;
import com.openfeint.api.resource.Leaderboard;
import com.openfeint.api.resource.Score;
import com.openfeint.api.ui.Dashboard;
import WR.HKZC.R;
import WR.HKZC.FDGame.FDGLevel;
import WR.HKZC.FDGame.FDGMark;
import WR.HKZC.FDGame.StoryType;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.view.animation.Animation.AnimationListener;
import android.webkit.WebView;
import android.widget.AbsoluteLayout;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ImageView.ScaleType;
public class Main extends Activity implements AnimationListener
{
// 有米
static{
AdManager.init("14273ef8472f42ba","7905a0a281a41503",30,false,1.0);
net.youmi.android.spotad.AdManager.init("14273ef8472f42ba","7905a0a281a41503",5,3,2,1,1.0f,false);
}
net.youmi.android.spotad.AdActivityListener linstener = new net.youmi.android.spotad.AdActivityListener() {
public void onAdActivityFinished() {
// TODO Auto-generated method stub
//通知您插播广告已经展示结束或者由于某些原因没有被展示,在这里添加调用展示插播广告结束后的下一步处理代码
// finish();
myExit();
}
};
//有米
private enum ScreenMode
{
SM_NONE,
SM_ASK,
SM_SPLASH,
SM_PAUSE,
SM_SETUP,
SM_MAINMENU,
SM_INTRO,
SM_STORY,
SM_MAP,
SM_PLAYING,
SM_WIN,
SM_LOSE,
SM_END,
SM_HELP,
SM_INPUTNAME,
SM_SCORE
};
// 常量定义
// private static final String DEBUG_TAG="WR.ZC debug";
private static final float CURRENTDESITY= 160f; //确定当前基准密度,避免图片错误缩放
private static final int TIMERATE=1; //时间分值
private static final int MARKRATE=10; //不同点分值
private static final float MISSRATE=0.1f; //失误分值
private static final int TOOLRATE=50; //工具分值
private static final int[] AWARDRATE={200,500,1000,2000}; //铜银金钻分值
private static final int BOUNCERATE=1000; //加工具分值
private static final int INITTOOL=2; //初始工具数量
private static final int SPEEDLIMIT=2000; //快手时间限制(毫秒)
private static final String[][] AWARDONLINEID={
{"1073551422","1073551432","1073551442","1073551452"},
{"1073551462","1073551472","1073551482","1073551492"},
{"1073551502","1073551512","1073551522","1073551532"},
{"1073551542","1073551552","1073551562","1073551572"}};
private static final String LEADBOARDID ="916950222";
//存储定义
private static final String PREFNAME="WR.JZZC";
private static final String LEVELNAME="Level";
private static final String TOTALSCORENAME="TotalScore";
private static final String TOOLNAME="Tool";
private static final String SAVENAME="SaveAward";
private static final String SPEEDNAME="SpeedAward";
private static final String INDEPENDENTNAME="IndependentAward";
private static final String ACCURATENAME="AccurateAward";
private static final String SAVECOUNTNAME="SaveAwardCount";
private static final String SPEEDCOUNTNAME="SpeedAwardCount";
private static final String INDEPENDENTCOUNTNAME="IndependentAwardCount";
private static final String ACCURATECOUNTNAME="AccurateAwardCount";
private static final String HISCORENAME="HiScore";
private static final String HISCORENAMENAME="HiScoreName";
private static final String BGMSETUPNAME="BGMSetup";
private class Marked
{
int iIndex;
boolean bFound;
};
private Bitmap _bmpMain=null;
//private Bitmap _bmpDiff=null;
private Bitmap _bmpCombin=null;
private FDGame _fdGame;
private AnimationDrawable _anim=null;
private int _iBGMusicMode=0;
//setting
private int _iLevel; //当前关卡数
private int _iLeftTime; //剩余时间
private int _iTools;//工具数量
private ArrayList _alMarked; //Marked类集合
private ScreenMode _iScreenMode;
//private boolean _bIsStart=false;
private int _iTotalScore; //总分
private int _iLevelScore; //关卡得分
private int _iLevelTool; //本关初始工具数量
private int _iHiScore; //最高分
private String _sHiScore; //最高分得主
//隐含属性
private int[][] _AwardLimit = new int[4][4];//{ 3,5,8,-1}; //奖励累计关卡数,为-1表示全部关卡
private int[] _iAward={0,0,0,0};//0~3 铜 银 金 钻 ,保存当前已获得数量
// 节约奖:铜:连续3关过关时间>50% 银:连续5关过关时间>50% 金:连续8关过关时间>50%(过关时累加,并判断剩余时间占总时间比例)
// 快手奖:铜:连续3关找到时间间隔不到3s 银:连续5关找到时间间隔不到3s 金:连续8关找到时间间隔不到3s 钻石:所有关找到时间间隔不到3s(游戏开始和点击触屏时判断时间,过关累加,并判断isTimeout)
// 独立奖:铜:连续3关未用工具 银:连续5关未用工具 金:连续8关未用工具 钻石:所有关卡未用工具 (过关时累加,并判断isUsedTool标志)
// 准确奖:铜:连续3关未Miss 银:连续5关未Miss 金:连续8关未miss 钻石:所有关卡未Miss(onTouch时累加判断)
private int[] _iAwardCount={0,0,0,0}; //奖关卡累计
private boolean _bCombo; //本关是否允许计入快手累计,如果两次有效点击之间的时间超过则此标志为false
private int _iCombo;
private long _lLastMillSec; //上次正确点击时间。
private boolean _bAccurateAward; //本关是否允许计入准确累计,如果本关有一次miss则此标志为false
///setting
/*
//线程函数
private Handler _mSplashHandler;
private Handler _mGameHandler;
private SplashThread _splashthread;
private GameThread _gamethread;
//启动画面线程类
class SplashThread extends Thread
{
public void run()
{
this.setName("SplashThread");
_iScreenMode=ScreenMode.SM_SPLASH;
while(true)
{
try
{
sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
Log.e(DEBUG_TAG,e.getMessage());
}
if(_anim==null)
{
Message toMain = _mSplashHandler.obtainMessage();
toMain.arg1=0;
_mSplashHandler.sendMessage(toMain);
}
else
{
if((_anim.getCurrent()== _anim.getFrame(_anim.getNumberOfFrames()-1))
|| !_anim.isRunning())
{
Message toMain = _mSplashHandler.obtainMessage();
toMain.arg1=1;
_mSplashHandler.sendMessage(toMain);
break;
}
// Log.d("WR.ZC.thread",String.valueOf(anim.isRunning()));
}
}
}
}
//游戏计时线程类
class GameThread extends Thread
{
public void run()
{
this.setName("GameThread");
while(true)
{
try
{
sleep(1000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
if(_iScreenMode== ScreenMode.SM_PAUSE)
{
continue;
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
香港大不同(游戏)Android源码 (864个子文件)
resources.ap_ 8.82MB
HKZC.apk 9.21MB
Main.class 39KB
OpenFeintInternal.class 33KB
WebViewCache.class 32KB
Utf8StreamParser.class 25KB
WebNav$ActionHandler.class 21KB
ReaderBasedParser.class 17KB
WriterBasedGenerator.class 15KB
WebNav.class 14KB
JsonParserBase.class 11KB
Base64.class 11KB
LastestGameData.class 11KB
JsonGeneratorBase.class 11KB
BaseRequest.class 11KB
OfflineSupport.class 11KB
JsonFactory.class 10KB
BytesToNameCanonicalizer.class 10KB
JsonNumericParserBase.class 9KB
Util.class 9KB
Resource.class 8KB
TextBuffer.class 8KB
OfflineSupport$DB.class 7KB
SyncedStore.class 7KB
WebNav$WebNavClient.class 7KB
Score.class 7KB
JsonResourceParser.class 7KB
ReadXML.class 7KB
JsonParser.class 7KB
FDGame.class 7KB
CookieStore.class 7KB
ImagePicker.class 7KB
ByteSourceBootstrapper.class 7KB
WebViewCache$ManifestData.class 7KB
Achievement.class 7KB
DB.class 6KB
OrderedArgList.class 6KB
Dashboard.class 6KB
CharsToNameCanonicalizer.class 6KB
Client.class 6KB
JsonGenerator.class 6KB
UTF8Writer.class 6KB
R$string.class 5KB
R$string.class 5KB
Base64Variant.class 5KB
Part.class 5KB
User.class 5KB
JavaType.class 5KB
Score$1.class 5KB
JsonNode.class 5KB
Leaderboard.class 5KB
NotificationBase.class 5KB
Encryption.class 5KB
ByteArrayBuilder.class 5KB
CloudStorage.class 4KB
IntroFlow$IntroFlowActionHandler.class 4KB
IOContext.class 4KB
AchievementNotification.class 4KB
Compression.class 4KB
R$drawable.class 4KB
GenericRequest.class 4KB
R$drawable.class 4KB
WebViewCache$ManifestRequest.class 4KB
SQLiteOpenHelperX.class 4KB
NumberOutput.class 4KB
TwoLineNotification.class 4KB
Hex.class 4KB
R$id.class 4KB
R$id.class 4KB
ReaderBasedNumericParser.class 4KB
FilePart.class 4KB
PercentEscaper.class 4KB
BaseRequest$1.class 4KB
MultipartHttpEntity.class 4KB
CacheRequest.class 4KB
Settings.class 3KB
SimpleNotification.class 3KB
UTF32Reader.class 3KB
CloudStorage$1.class 3KB
NativeBrowser.class 3KB
WebNav$WebNavChromeClient.class 3KB
DefaultPrettyPrinter.class 3KB
OpenFeintInternal$2.class 3KB
BlobPostRequest.class 3KB
UnicodeEscaper.class 3KB
CharTypes.class 3KB
Settings$SettingsActionHandler.class 3KB
Achievement$4.class 3KB
JsonReadContext.class 3KB
Utf8NumericParser.class 3KB
OpenFeintInternal$9.class 3KB
JsonLocation.class 3KB
JsonToken.class 3KB
Analytics.class 3KB
OpenFeintInternal$4.class 3KB
Signer.class 3KB
DateResourceProperty.class 3KB
StringUtils.class 3KB
OpenFeintSettings.class 3KB
FDGame$FDGLevel.class 2KB
共 864 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
- mczhang132014-10-30有错误,无法运行啊
- dezng2021-04-15代码比较旧,里面 SDK 相关依赖调用删除调就好了
- niyege12032014-05-07坑爹啊,缺少以个什么广告包,就不能运行啊,坑啊~~~~
wangru
- 粉丝: 11
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功