有什么游戏是飞机在空中水平飞行飞也可以打飞机炸陆地的火车.战艇的游戏

分享给朋友:把视频贴到Blog或BBS&&通用代码: <input id="link4" type="text" class="form_input form_input_s" value="" />复 制flash地址: 复 制html代码: <input type="text" class="form_input form_input_s" id="link3" value="" />复 制分享视频到站外获取收益&&手机扫码分享视频二维码2小时内有效【有料解说】房间战争
这是一群外星人机佬打飞机的游戏下载至电脑扫码用手机看用或微信扫码在手机上继续观看二维码2小时内有效【有料解说】房间战争
这是一群外星人机佬打飞机的游戏扫码用手机继续看用或微信扫码在手机上继续观看二维码2小时内有效,扫码后可分享给好友没有优酷APP?立即下载请根据您的设备选择下载版本
药品服务许可证(京)-经营-
节目制作经营许可证京字670号
请使用者仔细阅读优酷、、
Copyright(C)2016 优酷
不良信息举报电话:打飞机小游戏,打飞机在线玩,2144小游戏&
打飞机关灯猜你喜欢↑↓←→控制飞机飞行;鼠标左键鼠标拖动飞机移动(点击屏幕导弹按钮可以使用导弹)相关小游戏玩单精选25款by 2144编辑20款by 2144编辑13款by 2144编辑18款by 2144编辑30款by 2144编辑网页游戏打飞机类型:大小:477.8KB如何开始
游戏加载完毕后点击[开始游戏]即可开始游戏
控制着战机消灭掉所有的敌人战机,挑战最高分数吧!
打飞机游戏介绍
打飞机:微信5.0版本带来了一个意外的惊喜——飞机大战,而这款火爆移动端的游戏也登陆了flash平台,原汁原味的涂鸦风格,简单但却不失趣味的游戏,一起来与2144的好友们PK下谁更会打飞机吧!游戏玩法 收起48小时热门
从2008年-2014年 快猴网一直在努力做到最好
备案编号:粤ICP备号-13746人阅读
android游戏(19)
根据敌机类型区分 敌机 运动逻辑 以及绘制
下午4:14:59
public class Enemy {
public int
public static final int TYPE_FLY = 1;
public static final int TYPE_DUCKL = 2;
public static final int TYPE_DUCKR = 3;
public Bitmap bmpE
public int x,
public int frameW, frameH;
private int frameI
private int;
public boolean isD
public Enemy(Bitmap bmpEnemy, int enemyType, int x, int y) {
this.bmpEnemy = bmpE
frameW = bmpEnemy.getWidth() / 10;
frameH = bmpEnemy.getHeight();
this.type = enemyT
switch (type) {
case TYPE_FLY:
speed = 25;
case TYPE_DUCKL:
speed = 3;
case TYPE_DUCKR:
speed = 3;
public void draw(Canvas canvas, Paint paint) {
canvas.save();
canvas.clipRect(x, y, x + frameW, y + frameH);
canvas.drawBitmap(bmpEnemy, x - frameIndex * frameW, y, paint);
canvas.restore();
public void logic() {
frameIndex++;
if (frameIndex &= 10) {
frameIndex = 0;
switch (type) {
case TYPE_FLY:
if (isDead == false) {
speed -= 1;
if (y &= -200) {
isDead = true;
case TYPE_DUCKL:
if (isDead == false) {
x += speed / 2;
if (x & MySurfaceView.screenW) {
isDead = true;
case TYPE_DUCKR:
if (isDead == false) {
x -= speed / 2;
if (x & -50) {
isDead = true;
在MySurfaceView 中 生成敌机
public class MySurfaceView extends SurfaceView implements Callback, Runnable {
private SurfaceH
private boolean
public static final int GAME_MENU = 0;
public static final int GAMEING = 1;
public static final int GAME_WIN = 2;
public static final int GAME_LOST = 3;
public static final int GAME_PAUSE = -1;
public static int gameState = GAME_MENU;
private Resources res = this.getResources();
private Bitmap bmpBackG
private Bitmap bmpB
private Bitmap bmpBoosB
private Bitmap bmpB
private Bitmap bmpButtonP
private Bitmap bmpEnemyD
private Bitmap bmpEnemyF
private Bitmap bmpEnemyB
private Bitmap bmpGameW
private Bitmap bmpGameL
private Bitmap bmpP
private Bitmap bmpPlayerHp;
private Bitmap bmpM
public static Bitmap bmpB
public static Bitmap bmpEnemyB
public static Bitmap bmpBossB
public static int screenW;
public static int screenH;
private Vector&Enemy& vcE
private int createEnemyTime = 50;
private int
private int enemyArray[][] = { { 1, 2 }, { 1, 1 }, { 1, 3, 1, 2 },
{ 1, 2 }, { 2, 3 }, { 3, 1, 3 }, { 2, 2 }, { 1, 2 }, { 2, 2 },
{ 1, 3, 1, 1 }, { 2, 1 }, { 1, 3 }, { 2, 1 }, { -1 } };
private int enemyArrayI
private boolean isB
private GameMenu gameM
private GameBg gameBg;
* SurfaceView初始化函数
public MySurfaceView(Context context) {
super(context);
sfh = this.getHolder();
sfh.addCallback(this);
paint = new Paint();
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
setFocusable(true);
* SurfaceView视图创建,响应此函数
public void surfaceCreated(SurfaceHolder holder) {
screenW = this.getWidth();
screenH = this.getHeight();
initGame();
flag = true;
th = new Thread(this);
th.start();
* 加载游戏资源
private void initGame() {
bmpBackGround = BitmapFactory
.decodeResource(res, R.drawable.background);
bmpBoom = BitmapFactory.decodeResource(res, R.drawable.boom);
bmpBoosBoom = BitmapFactory.decodeResource(res, R.drawable.boos_boom);
bmpButton = BitmapFactory.decodeResource(res, R.drawable.button);
bmpButtonPress = BitmapFactory.decodeResource(res,
R.drawable.button_press);
bmpEnemyDuck = BitmapFactory.decodeResource(res, R.drawable.enemy_duck);
bmpEnemyFly = BitmapFactory.decodeResource(res, R.drawable.enemy_fly);
bmpEnemyBoos = BitmapFactory.decodeResource(res, R.drawable.enemy_pig);
bmpGameWin = BitmapFactory.decodeResource(res, R.drawable.gamewin);
bmpGameLost = BitmapFactory.decodeResource(res, R.drawable.gamelost);
bmpPlayer = BitmapFactory.decodeResource(res, R.drawable.player);
bmpPlayerHp = BitmapFactory.decodeResource(res, R.drawable.hp);
bmpMenu = BitmapFactory.decodeResource(res, R.drawable.menu);
bmpBullet = BitmapFactory.decodeResource(res, R.drawable.bullet);
bmpEnemyBullet = BitmapFactory.decodeResource(res,
R.drawable.bullet_enemy);
bmpBossBullet = BitmapFactory
.decodeResource(res, R.drawable.boosbullet);
gameMenu = new GameMenu(bmpMenu, bmpButton, bmpButtonPress);
gameBg = new GameBg(bmpBackGround);
player = new Player(bmpPlayer, bmpPlayerHp);
vcEnemy = new Vector&Enemy&();
random = new Random();
* 游戏绘图
public void myDraw() {
canvas = sfh.lockCanvas();
if (canvas != null) {
canvas.drawColor(Color.WHITE);
switch (gameState) {
case GAME_MENU:
gameMenu.draw(canvas, paint);
case GAMEING:
gameBg.draw(canvas, paint);
player.draw(canvas, paint);
if (isBoss == false) {
for (int i = 0; i & vcEnemy.size(); i++) {
vcEnemy.elementAt(i).draw(canvas, paint);
case GAME_WIN:
case GAME_LOST:
case GAME_PAUSE:
} catch (Exception e) {
} finally {
if (canvas != null)
sfh.unlockCanvasAndPost(canvas);
* 触屏事件监听
public boolean onTouchEvent(MotionEvent event) {
switch (gameState) {
case GAME_MENU:
gameMenu.onTouchEvent(event);
case GAMEING:
case GAME_WIN:
case GAME_LOST:
case GAME_PAUSE:
return true;
* 按键事件监听
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (gameState) {
case GAME_MENU:
case GAMEING:
player.onKeyDown(keyCode, event);
case GAME_WIN:
case GAME_LOST:
case GAME_PAUSE:
return super.onKeyDown(keyCode, event);
public boolean onKeyUp(int keyCode, KeyEvent event) {
switch (gameState) {
case GAME_MENU:
case GAMEING:
player.onKeyUp(keyCode, event);
case GAME_WIN:
case GAME_LOST:
case GAME_PAUSE:
return super.onKeyUp(keyCode, event);
* 游戏逻辑
private void logic() {
switch (gameState) {
case GAME_MENU:
case GAMEING:
gameBg.logic();
player.logic();
if (isBoss == false) {
for (int i = 0; i & vcEnemy.size(); i++) {
Enemy en = vcEnemy.elementAt(i);
if (en.isDead) {
vcEnemy.removeElementAt(i);
en.logic();
if (count % createEnemyTime == 0) {
for (int i = 0; i & enemyArray[enemyArrayIndex]. i++) {
if (enemyArray[enemyArrayIndex][i] == 1) {
int x = random.nextInt(screenW - 100) + 50;
vcEnemy.addElement(new Enemy(bmpEnemyFly, 1, x, -50));
} else if (enemyArray[enemyArrayIndex][i] == 2) {
int y = random.nextInt(20);
vcEnemy.addElement(new Enemy(bmpEnemyDuck, 2, -50,
} else if (enemyArray[enemyArrayIndex][i] == 3) {
int y = random.nextInt(20);
vcEnemy.addElement(new Enemy(bmpEnemyDuck, 3,
screenW + 50, y));
if (enemyArrayIndex == enemyArray.length - 1) {
isBoss = true;
enemyArrayIndex++;
case GAME_WIN:
case GAME_LOST:
case GAME_PAUSE:
public void run() {
while (flag) {
long start = System.currentTimeMillis();
long end = System.currentTimeMillis();
if (end - start & 50) {
Thread.sleep(50 - (end - start));
} catch (InterruptedException e) {
e.printStackTrace();
* SurfaceView视图状态发生改变,响应此函数
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
* SurfaceView视图消亡时,响应此函数
public void surfaceDestroyed(SurfaceHolder holder) {
flag = false;
修改Player类
package com.
import android.graphics.B
import android.graphics.C
import android.graphics.P
import android.view.KeyE
public class Player {
private int playerHp = 3;
private Bitmap bmpPlayerHP;
private int x,
private Bitmap bmpP
private int speed = 5;
private boolean isUp, isDown, isLeft, isR
public Player(Bitmap bmpPlayer, Bitmap bmpPlayerHp) {
this.bmpPlayer = bmpP
this.bmpPlayerHP = bmpPlayerHp;
x = MySurfaceView.screenW / 2 - bmpPlayer.getWidth() / 2;
y = MySurfaceView.screenH - bmpPlayer.getHeight();
public void draw(Canvas canvas, Paint paint) {
canvas.drawBitmap(bmpPlayer, x, y, paint);
for (int i = 0; i & playerHp; i++) {
canvas.drawBitmap(bmpPlayerHP, i * bmpPlayerHP.getWidth(),
MySurfaceView.screenH - bmpPlayerHP.getHeight(), paint);
* 按键事件监听
public void onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
isUp = true;
if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
isDown = true;
if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
isLeft = true;
if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
isRight = true;
public void onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
isUp = false;
if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
isDown = false;
if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {
isLeft = false;
if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
isRight = false;
* 游戏逻辑
public void logic() {
if (isUp) {
if (isDown) {
if (isLeft) {
if (isRight) {
if (x + bmpPlayer.getWidth() &= MySurfaceView.screenW) {
x = MySurfaceView.screenW - bmpPlayer.getWidth();
} else if (x &= 0) {
if (y + bmpPlayer.getHeight() &= MySurfaceView.screenH) {
y = MySurfaceView.screenH - bmpPlayer.getHeight();
} else if (y &= 0) {
public void setPlayerHp(int hp) {
this.playerHp =
public int getPlayerHp() {
return playerHp;
public boolean isCollsionWith(Enemy bullet) {
int x2 = bullet.x;
int y2 = bullet.y;
int w2 = bullet.frameW;
int h2 = bullet.frameH;
if (x &= x2 && x &= x2 + w2) {
return false;
} else if (x &= x2 && x + bmpPlayer.getWidth() &= x2) {
return false;
} else if (y &= y2 && y &= y2 + h2) {
return false;
} else if (y &= y2 && y + bmpPlayer.getHeight() &= y2) {
return false;
return true;
在MySurface中 加上碰撞逻辑
* 游戏逻辑
private void logic() {
switch (gameState) {
case GAME_MENU:
case GAMEING:
gameBg.logic();
player.logic();
if (isBoss == false) {
for (int i = 0; i & vcEnemy.size(); i++) {
Enemy en = vcEnemy.elementAt(i);
if (en.isDead) {
vcEnemy.removeElementAt(i);
en.logic();
if (count % createEnemyTime == 0) {
for (int i = 0; i & enemyArray[enemyArrayIndex]. i++) {
if (enemyArray[enemyArrayIndex][i] == 1) {
int x = random.nextInt(screenW - 100) + 50;
vcEnemy.addElement(new Enemy(bmpEnemyFly, 1, x, -50));
} else if (enemyArray[enemyArrayIndex][i] == 2) {
int y = random.nextInt(20);
vcEnemy.addElement(new Enemy(bmpEnemyDuck, 2, -50,
} else if (enemyArray[enemyArrayIndex][i] == 3) {
int y = random.nextInt(20);
vcEnemy.addElement(new Enemy(bmpEnemyDuck, 3,
screenW + 50, y));
if (enemyArrayIndex == enemyArray.length - 1) {
isBoss = true;
enemyArrayIndex++;
for (int i = 0; i & vcEnemy.size(); i++) {
if (player.isCollsionWith(vcEnemy.elementAt(i))) {
player.setPlayerHp(player.getPlayerHp() - 1);
if (player.getPlayerHp() &= -1) {
gameState = GAME_LOST;
private int noCollisionCount = 0;
private int noCollisionTime = 60;
private boolean isC
public boolean isCollsionWith(Enemy en) {
if (isCollision == false) {
int x2 = en.x;
int y2 = en.y;
int w2 = en.frameW;
int h2 = en.frameH;
if (x &= x2 && x &= x2 + w2) {
return false;
} else if (x &= x2 && x + bmpPlayer.getWidth() &= x2) {
return false;
} else if (y &= y2 && y &= y2 + h2) {
return false;
} else if (y &= y2 && y + bmpPlayer.getHeight() &= y2) {
return false;
isCollision = true;
return true;
return false;
修改逻辑方法
* 游戏逻辑
public void logic() {
if (isUp) {
if (isDown) {
if (isLeft) {
if (isRight) {
if (x + bmpPlayer.getWidth() &= MySurfaceView.screenW) {
x = MySurfaceView.screenW - bmpPlayer.getWidth();
} else if (x &= 0) {
if (y + bmpPlayer.getHeight() &= MySurfaceView.screenH) {
y = MySurfaceView.screenH - bmpPlayer.getHeight();
} else if (y &= 0) {
if (isCollision) {
noCollisionCount++;
if (noCollisionCount &= noCollisionTime) {
isCollision = false;
noCollisionCount = 0;
修改主角的绘制
public void draw(Canvas canvas, Paint paint) {
if (isCollision) {
if (noCollisionCount % 2 == 0) {
canvas.drawBitmap(bmpPlayer, x, y, paint);
canvas.drawBitmap(bmpPlayer, x, y, paint);
for (int i = 0; i & playerHp; i++) {
canvas.drawBitmap(bmpPlayerHP, i * bmpPlayerHP.getWidth(),
MySurfaceView.screenH - bmpPlayerHP.getHeight(), paint);
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:62672次
积分:1636
积分:1636
排名:第19673名
原创:96篇
转载:27篇
评论:45条
(2)(2)(8)(11)(4)(7)(17)(2)(2)(1)(2)(1)(2)(4)(1)(2)(3)(1)(1)(20)(28)(1)(1)

我要回帖

更多关于 女人炸潜水艇 的文章

 

随机推荐