微信游戏打飞机游戏制作(java模拟微信打飞机游戏)_java

复制代码 代码如下:

package com.beancore.ui;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

import com.beancore.config.Config;
import com.beancore.config.ImageConstants;
import com.beancore.entity.Score;
import com.beancore.util.FileUtil;
import com.beancore.util.ImageLoader;
import com.beancore.util.Images;
import com.beancore.util.SoundPlayer;

public class MainFrame extends JFrame implements ActionListener {

    private static final long serialVersionUID = 1L;
    private ImageLoader imgLoader;

    private GameLoadingPanel gameLoadingPanel;
    private GamePlayingPanel gamePlayingPanel;

    private PopupMenuPanel popupMenuPanel;
    private Top10ScorePanel popupScorePanel;
    private HelpDialog helpDialog;

    private SoundPlayer achievementSoundPlayer;

    private List<Score> scoreList;

    public MainFrame() throws IOException, LineUnavailableException, UnsupportedAudioFileException {
 try {
     this.scoreList = FileUtil.readScore(Config.SCORE_FILE);
 } catch (Exception e) {
     this.scoreList = new ArrayList<Score>();
 }
 this.loadImage();
 this.initSoundPlayer();
 this.initComponents();
 this.setBackgroundImage();
    }

    /**
     * Load the image part from the whole image, shoot_background.png shoot.png
     * are both extracted from the weixin apk file
     * */
    private void loadImage() throws IOException {
 this.imgLoader = new ImageLoader(Config.SHOOT_BACKGROUND_IMG);
 Images.GAME_LOADING_IMG1 = this.imgLoader.getImage(ImageConstants.GAME_LOADING_PLANE_1_POS_X,
  ImageConstants.GAME_LOADING_PLANE_1_POS_Y, ImageConstants.GAME_LOADING_PLANE_1_WIDTH,
  ImageConstants.GAME_LOADING_PLANE_1_HEIGHT);
 Images.GAME_LOADING_IMG2 = this.imgLoader.getImage(ImageConstants.GAME_LOADING_PLANE_2_POS_X,
  ImageConstants.GAME_LOADING_PLANE_2_POS_Y, ImageConstants.GAME_LOADING_PLANE_2_WIDTH,
  ImageConstants.GAME_LOADING_PLANE_2_HEIGHT);
 Images.GAME_LOADING_IMG3 = this.imgLoader.getImage(ImageConstants.GAME_LOADING_PLANE_3_POS_X,
  ImageConstants.GAME_LOADING_PLANE_3_POS_Y, ImageConstants.GAME_LOADING_PLANE_3_WIDTH,
  ImageConstants.GAME_LOADING_PLANE_3_HEIGHT);

 Images.SHOOT_BACKGROUND_IMG = this.imgLoader.getImage(ImageConstants.GAME_BACKGROUND_IMG_POS_X,
  ImageConstants.GAME_BACKGROUND_IMG_POS_Y, ImageConstants.GAME_BACKGROUND_IMG_WIDTH,
  ImageConstants.GAME_BACKGROUND_IMG_HEIGHT);

 Images.GAME_LOADING_TEXT_IMG = this.imgLoader.getImage(ImageConstants.GAME_LOADING_TEXT_IMG_POS_X,
  ImageConstants.GAME_LOADING_TEXT_IMG_POS_Y, ImageConstants.GAME_LOADING_TEXT_IMG_WIDTH,
  ImageConstants.GAME_LOADING_TEXT_IMG_HEIGHT);

 this.imgLoader = new ImageLoader(Config.SHOOT_IMG);
 Images.YELLOW_BULLET_IMG = this.imgLoader.getImage(ImageConstants.YELLOW_BULLET_POS_X,
  ImageConstants.YELLOW_BULLET_POS_Y, ImageConstants.YELLOW_BULLET_WIDTH,
  ImageConstants.YELLOW_BULLET_HEIGHT);
 Images.BLUE_BULLET_IMG = this.imgLoader.getImage(ImageConstants.BLUE_BULLET_POS_X,
  ImageConstants.BLUE_BULLET_POS_Y, ImageConstants.BLUE_BULLET_WIDTH, ImageConstants.BLUE_BULLET_HEIGHT);
 Images.MY_PLANE_IMG = this.imgLoader.getImage(ImageConstants.MY_PLANE_POS_X, ImageConstants.MY_PLANE_POS_Y,
  ImageConstants.MY_PLANE_WIDTH, ImageConstants.MY_PLANE_HEIGHT);
 Images.MY_PLANE_FLYING_IMG = this.imgLoader.getImage(ImageConstants.MY_PLANE_FLYING_POS_X,
  ImageConstants.MY_PLANE_FLYING_POS_Y, ImageConstants.MY_PLANE_FLYING_WIDTH,
  ImageConstants.MY_PLANE_FLYING_HEIGHT);
 Images.SMALL_PLANE_IMG = this.imgLoader.getImage(ImageConstants.SMALL_PLANE_POS_X,
  ImageConstants.SMALL_PLANE_POS_Y, ImageConstants.SMALL_PLANE_WIDTH, ImageConstants.SMALL_PLANE_HEIGHT);
 Images.BIG_PLANE_IMG = this.imgLoader.getImage(ImageConstants.BIG_PLANE_POS_X, ImageConstants.BIG_PLANE_POS_Y,
  ImageConstants.BIG_PLANE_WIDTH, ImageConstants.BIG_PLANE_HEIGHT);
 Images.BOSS_PLANE_IMG = this.imgLoader.getImage(ImageConstants.BOSS_PLANE_POS_X,
  ImageConstants.BOSS_PLANE_POS_Y, ImageConstants.BOSS_PLANE_WIDTH, ImageConstants.BOSS_PLANE_HEIGHT);
 Images.BOMB_IMG = this.imgLoader.getImage(ImageConstants.BOMB_POS_X, ImageConstants.BOMB_POS_Y,
  ImageConstants.BOMB_WIDTH, ImageConstants.BOMB_HEIGHT);
 Images.CAUGHT_BOMB_IMG = this.imgLoader.getImage(ImageConstants.CAUGHT_BOMB_POS_X,
  ImageConstants.CAUGHT_BOMB_POS_Y, ImageConstants.CAUGHT_BOMB_WIDTH, ImageConstants.CAUGHT_BOMB_HEIGHT);
 Images.DOUBLE_LASER_IMG = this.imgLoader.getImage(ImageConstants.DOUBLE_LASER_POS_X,
  ImageConstants.DOUBLE_LASER_POS_Y, ImageConstants.DOUBLE_LASER_WIDTH,
  ImageConstants.DOUBLE_LASER_HEIGHT);

 Images.SMALL_PLANE_FIGHTING_IMG = this.imgLoader.getImage(ImageConstants.SMALL_PLANE_FIGHTING_POS_X,
  ImageConstants.SMALL_PLANE_FIGHTING_POS_Y, ImageConstants.SMALL_PLANE_FIGHTING_WIDTH,
  ImageConstants.SMALL_PLANE_FIGHTING_HEIGHT);
 Images.SMALL_PLANE_KILLED_IMG = this.imgLoader.getImage(ImageConstants.SMALL_PLANE_KILLED_POS_X,
  ImageConstants.SMALL_PLANE_KILLED_POS_Y, ImageConstants.SMALL_PLANE_KILLED_WIDTH,
  ImageConstants.SMALL_PLANE_KILLED_HEIGHT);
 Images.SMALL_PLANE_ASHED_IMG = this.imgLoader.getImage(ImageConstants.SMALL_PLANE_ASHED_POS_X,
  ImageConstants.SMALL_PLANE_ASHED_POS_Y, ImageConstants.SMALL_PLANE_ASHED_WIDTH,
  ImageConstants.SMALL_PLANE_ASHED_HEIGHT);

 Images.BIG_PLANE_FIGHTING_IMG = this.imgLoader.getImage(ImageConstants.BIG_PLANE_FIGHTING_POS_X,
  ImageConstants.BIG_PLANE_FIGHTING_POS_Y, ImageConstants.BIG_PLANE_FIGHTING_WIDTH,
  ImageConstants.BIG_PLANE_FIGHTING_HEIGHT);
 Images.BIG_PLANE_HITTED_IMG = this.imgLoader.getImage(ImageConstants.BIG_PLANE_HITTED_POS_X,
  ImageConstants.BIG_PLANE_HITTED_POS_Y, ImageConstants.BIG_PLANE_HITTED_WIDTH,
  ImageConstants.BIG_PLANE_HITTED_HEIGHT);
 Images.BIG_PLANE_BADDLY_WOUNDED_IMG = this.imgLoader.getImage(ImageConstants.BIG_PLANE_BADDLY_WOUNDED_POS_X,
  ImageConstants.BIG_PLANE_BADDLY_WOUNDED_POS_Y, ImageConstants.BIG_PLANE_BADDLY_WOUNDED_WIDTH,
  ImageConstants.BIG_PLANE_BADDLY_WOUNDED_HEIGHT);
 Images.BIG_PLANE_KILLED_IMG = this.imgLoader.getImage(ImageConstants.BIG_PLANE_KILLED_POS_X,
  ImageConstants.BIG_PLANE_KILLED_POS_Y, ImageConstants.BIG_PLANE_KILLED_WIDTH,
  ImageConstants.BIG_PLANE_KILLED_HEIGHT);
 Images.BIG_PLANE_ASHED_IMG = this.imgLoader.getImage(ImageConstants.BIG_PLANE_ASHED_POS_X,
  ImageConstants.BIG_PLANE_ASHED_POS_Y, ImageConstants.BIG_PLANE_ASHED_WIDTH,
  ImageConstants.BIG_PLANE_ASHED_HEIGHT);

 Images.BOSS_PLANE_FIGHTING_IMG = this.imgLoader.getImage(ImageConstants.BOSS_PLANE_FIGHTING_POS_X,
  ImageConstants.BOSS_PLANE_FIGHTING_POS_Y, ImageConstants.BOSS_PLANE_FIGHTING_WIDTH,
  ImageConstants.BOSS_PLANE_FIGHTING_HEIGHT);
 Images.BOSS_PLANE_HITTED_IMG = this.imgLoader.getImage(ImageConstants.BOSS_PLANE_HITTED_POS_X,
  ImageConstants.BOSS_PLANE_HITTED_POS_Y, ImageConstants.BOSS_PLANE_HITTED_WIDTH,
  ImageConstants.BOSS_PLANE_HITTED_HEIGHT);
 Images.BOSS_PLANE_BADDLY_WOUNDED_IMG = this.imgLoader.getImage(ImageConstants.BOSS_PLANE_BADDLY_WOUNDED_POS_X,
  ImageConstants.BOSS_PLANE_BADDLY_WOUNDED_POS_Y, ImageConstants.BOSS_PLANE_BADDLY_WOUNDED_WIDTH,
  ImageConstants.BOSS_PLANE_BADDLY_WOUNDED_HEIGHT);
 Images.BOSS_PLANE_KILLED_IMG = this.imgLoader.getImage(ImageConstants.BOSS_PLANE_KILLED_POS_X,
  ImageConstants.BOSS_PLANE_KILLED_POS_Y, ImageConstants.BOSS_PLANE_KILLED_WIDTH,
  ImageConstants.BOSS_PLANE_KILLED_HEIGHT);
 Images.BOSS_PLANE_ASHED_IMG = this.imgLoader.getImage(ImageConstants.BOSS_PLANE_ASHED_POS_X,
  ImageConstants.BOSS_PLANE_ASHED_POS_Y, ImageConstants.BOSS_PLANE_ASHED_WIDTH,
  ImageConstants.BOSS_PLANE_ASHED_HEIGHT);

 Images.SCORE_IMG = this.imgLoader.getImage(ImageConstants.SCORE_IMG_POS_X, ImageConstants.SCORE_IMG_POS_Y,
  ImageConstants.SCORE_IMG_WIDTH, ImageConstants.SCORE_IMG_HEIGHT);

 this.imgLoader = new ImageLoader(Config.FONT_IMG);
 Images.X_MARK_IMG = this.imgLoader.getImage(ImageConstants.X_MARK_POS_X, ImageConstants.X_MARK_POS_Y,
  ImageConstants.X_MARK_WIDTH, ImageConstants.X_MARK_HEIGHT);

 Images.NUMBER_0_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_0_POS_X, ImageConstants.NUMBER_0_POS_Y,
  ImageConstants.NUMBER_0_WIDTH, ImageConstants.NUMBER_0_HEIGHT);
 Images.NUMBER_1_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_1_POS_X, ImageConstants.NUMBER_1_POS_Y,
  ImageConstants.NUMBER_1_WIDTH, ImageConstants.NUMBER_1_HEIGHT);
 Images.NUMBER_2_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_2_POS_X, ImageConstants.NUMBER_2_POS_Y,
  ImageConstants.NUMBER_2_WIDTH, ImageConstants.NUMBER_2_HEIGHT);
 Images.NUMBER_3_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_3_POS_X, ImageConstants.NUMBER_3_POS_Y,
  ImageConstants.NUMBER_3_WIDTH, ImageConstants.NUMBER_3_HEIGHT);
 Images.NUMBER_4_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_4_POS_X, ImageConstants.NUMBER_4_POS_Y,
  ImageConstants.NUMBER_4_WIDTH, ImageConstants.NUMBER_4_HEIGHT);
 Images.NUMBER_5_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_5_POS_X, ImageConstants.NUMBER_5_POS_Y,
  ImageConstants.NUMBER_5_WIDTH, ImageConstants.NUMBER_5_HEIGHT);
 Images.NUMBER_6_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_6_POS_X, ImageConstants.NUMBER_6_POS_Y,
  ImageConstants.NUMBER_6_WIDTH, ImageConstants.NUMBER_6_HEIGHT);
 Images.NUMBER_7_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_7_POS_X, ImageConstants.NUMBER_7_POS_Y,
  ImageConstants.NUMBER_7_WIDTH, ImageConstants.NUMBER_7_HEIGHT);
 Images.NUMBER_8_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_8_POS_X, ImageConstants.NUMBER_8_POS_Y,
  ImageConstants.NUMBER_8_WIDTH, ImageConstants.NUMBER_8_HEIGHT);
 Images.NUMBER_9_IMG = this.imgLoader.getImage(ImageConstants.NUMBER_9_POS_X, ImageConstants.NUMBER_9_POS_Y,
  ImageConstants.NUMBER_9_WIDTH, ImageConstants.NUMBER_9_HEIGHT);
    }

    private void initComponents() {
 this.setTitle("Shoot Plane - www.java1234.com");
 this.setIconImage(new ImageIcon(Config.LOGO_IMG).getImage());
 this.setSize(Config.MAIN_FRAME_WIDTH, Config.MAIN_FRAME_HEIGHT);
 Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
 this.setBounds((d.width - Config.MAIN_FRAME_WIDTH) / 2, (d.height - Config.MAIN_FRAME_HEIGHT) / 2,
  Config.MAIN_FRAME_WIDTH, Config.MAIN_FRAME_HEIGHT);
 this.setResizable(false);
 this.setVisible(true);
 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    private void initSoundPlayer() throws LineUnavailableException, UnsupportedAudioFileException, IOException {
 achievementSoundPlayer = new SoundPlayer(Config.ACHIEVEMENT_AUDIO);
    }

    private void setBackgroundImage() {
 ImageIcon bgImgIcon = new ImageIcon(Images.SHOOT_BACKGROUND_IMG);
 JLabel bgLabel = new JLabel(bgImgIcon);
 this.getLayeredPane().add(bgLabel, new Integer(Integer.MIN_VALUE));
 bgLabel.setBounds(0, 0, bgImgIcon.getIconWidth(), bgImgIcon.getIconHeight());
 ((JPanel) this.getContentPane()).setOpaque(false);
    }

    private void popupMenuPanel() {
 Container c = this.getContentPane();
 c.removeAll();
 this.repaint();
 if (this.popupMenuPanel == null) {
     this.popupMenuPanel = new PopupMenuPanel(this);
 }
 BoxLayout boxLayout = new BoxLayout(c, BoxLayout.Y_AXIS);
 c.setLayout(boxLayout);
 c.add(Box.createVerticalGlue());
 c.add(this.popupMenuPanel);
 c.add(Box.createVerticalGlue());
 this.validate();
    }

    public void loadGame() throws LineUnavailableException, UnsupportedAudioFileException, IOException {
 Container c = this.getContentPane();
 c.removeAll();
 this.repaint();
 if (this.gameLoadingPanel == null) {
     this.gameLoadingPanel = new GameLoadingPanel();
 }

 BoxLayout boxLayout = new BoxLayout(c, BoxLayout.Y_AXIS);
 c.setLayout(boxLayout);
 c.add(Box.createVerticalGlue());
 c.add(this.gameLoadingPanel);
 c.add(Box.createVerticalGlue());
 this.gameLoadingPanel.loadingGame();

 this.startGame();
    }

    private void startGame() throws LineUnavailableException, UnsupportedAudioFileException, IOException {
 Container c = this.getContentPane();
 c.removeAll();
 this.repaint();
 BorderLayout borderLayout = new BorderLayout();
 c.setLayout(borderLayout);
 this.gamePlayingPanel = new GamePlayingPanel();
 c.add(this.gamePlayingPanel, BorderLayout.CENTER);
 this.gamePlayingPanel.startGame();
 long startTime = System.currentTimeMillis();
 while (this.gamePlayingPanel.getMyPlane().isAlive()) {
     try {
  Thread.sleep(Config.GAME_PANEL_REPAINT_INTERVAL);
     } catch (InterruptedException e) {
  e.printStackTrace();
     }
 }
 long endTime = System.currentTimeMillis();
 // add to score list
 this.addScore(this.gamePlayingPanel.getScore(), endTime - startTime);
 int option = JOptionPane.showConfirmDialog(this, "Game Over, Score:" + this.gamePlayingPanel.getScore()
  + ", Start Again?", "Game Over", JOptionPane.YES_NO_OPTION);
 switch (option) {
 case JOptionPane.YES_OPTION:
     loadGame();
     break;
 case JOptionPane.NO_OPTION:
     stopGame();
     break;
 }
    }

    private void addScore(int score, long lastMilliSeconds) throws IOException {
 Score s = new Score(new Date(System.currentTimeMillis()), score, lastMilliSeconds);
 int size = this.scoreList.size();
 if (this.scoreList.contains(s)) {
     return;
 }
 if (size < Config.MAX_SCORE_COUNT) {
     this.scoreList.add(s);
 } else {
     Score lastScore = this.scoreList.get(size - 1);
     if (s.compareTo(lastScore) > 0) {
  this.scoreList.remove(lastScore);
  this.scoreList.add(s);
     }
 }
 Collections.sort(this.scoreList);
 Collections.reverse(this.scoreList);
 FileUtil.writeScore(scoreList, Config.SCORE_FILE);
    }

    public void stopGame() {
 popupMenuPanel();
    }

    @Override
    public void actionPerformed(ActionEvent e) {
 String actionCmd = e.getActionCommand();
 if (actionCmd.equals(PopupMenuPanel.START_GAME_BUTTON)) {
     startGameAction();
 } else if (actionCmd.equals(PopupMenuPanel.TOP_10_SCORES_BUTTON)) {
     this.achievementSoundPlayer.play();
     popupScorePanel(this.scoreList);
 } else if (actionCmd.equals(PopupMenuPanel.EXIT_GAME_BUTTON)) {
     exitGameAction();
 } else if (actionCmd.equals(PopupMenuPanel.HELP_BUTTON)) {
     helpAction();
 } else if (actionCmd.equals(Top10ScorePanel.OK_BUTTON)) {
     this.popupMenuPanel();
 }
    }

    private void popupScorePanel(List<Score> sortedScoreList) {
 Container c = this.getContentPane();
 c.removeAll();
 this.repaint();
 if (this.popupScorePanel == null) {
     this.popupScorePanel = new Top10ScorePanel(this);
 }
 this.popupScorePanel.loadScore(sortedScoreList);
 BoxLayout boxLayout = new BoxLayout(c, BoxLayout.Y_AXIS);
 c.setLayout(boxLayout);
 c.add(Box.createVerticalGlue());
 c.add(this.popupScorePanel);
 c.add(Box.createVerticalGlue());
 this.validate();
    }

    private void startGameAction() {
 new Thread(new StartGameActionClass()).start();
    }

    class StartGameActionClass implements Runnable {

 @Override
 public void run() {
     try {
  loadGame();
     } catch (Exception e) {
  e.printStackTrace();
     }
 }
    }

    private void exitGameAction() {
 System.exit(0);
    }

    private void helpAction() {
 if (this.helpDialog == null) {
     this.helpDialog = new HelpDialog();
 }
 this.helpDialog.setVisible(true);
    }
}

时间: 2024-10-08 04:16:32

微信游戏打飞机游戏制作(java模拟微信打飞机游戏)_java的相关文章

java记忆翻牌游戏代码-JAVA做出记忆翻牌游戏,菜鸟想学习JAVA的游戏制作

问题描述 JAVA做出记忆翻牌游戏,菜鸟想学习JAVA的游戏制作 20C 1.界面打开为网格,每个网格放一张图片,图片两两相同2.点开两张图片若是一样则显示,若是不一样,显示50ms,变为背面.3.每轮游戏结束时显示总共花费时间.4.重复步骤2,直到所有图片显示出来 解决方案 http://download.csdn.net/detail/gaoda871010/2652900http://www.educity.cn/xiazai/8649772.html 解决方案二: 看下我写的这个怎么样.

致敬微信玩即时游戏 Facebook是要变身“美国版微信”吗?

福布斯网络版近日撰文称,近些年来,中国的互联网公司走出了自己的路,在理念上领先世界,因此美国公司也开始向中国产品取经,Facebook在Messenger平台推出的"即时游戏"功能就是对微信的致敬.于是有人诞生了这样的疑问,Facebook也会走上大一统之路,渗入美国人生活的方方面面,从而成为"美国版微信"吗? 上周,Facebook在其即时通信应用Messenger平台推出了"即时游戏"功能.与此前玩游戏需要下载不同,这次Messenger直接

关于java问题-关于Java能不能开发网页游戏,前辈们给我说说

问题描述 关于Java能不能开发网页游戏,前辈们给我说说 刚学了Java下,可以做数据库实现网页上的增删改查,也可以编最简单的贪吃蛇,想问问前辈们这个贪食蛇可不可以放到网页上? 就是我打开网页就能玩游戏,在自己机子上运行就可以,大神们,come,求指点 解决方案 那就网页游戏,简称页游.不是用java开发的,是用javascript开发,或者用flex等RIA技术开发.

音频-我用java写了一个小游戏,想插入背景音乐但不太会,求指教

问题描述 我用java写了一个小游戏,想插入背景音乐但不太会,求指教 package text; import java.io.*; import javax.sound.sampled.*; public class text { public static void main(String[] args) { // TODO Auto-generated method stub //创建一个实例 AePlayWave apw = new AePlayWave("G:\照片\Sleep Awa

Flash 游戏的规划与制作流程

规划 在决定好将要制作的游戏的目标与类型后,接下来是不是可以立即开始制作游戏了呢?这里的回答是不可以!当然如果你一定要坚持立即开是制作,也不是不可以,只不过要事先提醒大家的是:如果你在制作游戏前还没有一个完整的规划,或者没有一个严谨的制作流程,那么必定将浪费你非常多的时间和精力,很有可能游戏还没制作完成,你就已经感到筋疲力尽了.所以制作前认真制定一个制作游戏流程和规划是十分必要的. 其实像Flash游戏这样的制作规划或者流程并没有你想象中的那么难,大致上只需要设想好游戏中会发生的所有情况,如果是

PS制作蓝色立体房子形状的游戏图标教程

教程学习如何用Photoshop制作一个房子形状的字母游戏图标,主要用到了减淡工具和图层样式,下面就让我们一起来学习吧. 先看效果图: 新建文档500x500像素,背景白色,新建图层,用钢笔做如下选区,填充#e9dfd6. 添加内阴影样式. 新建图层用钢笔画出下图形状,填充#002da2. 分类: PS鼠绘教程 ps图标制作教程

jQuery制作可自定义大小的拼图游戏

 这篇文章主要介绍了jQuery制作可自定义大小的拼图游戏的代码,非常的简单实用,虽然还只是局限于数字顺序的拼图,后续慢慢完善上图片,但还是分享给大家,有需要的小伙伴可以参考下.     我把大小限制在了3-10之间,实在闲的,或者有自虐倾向的可以试试改下.. 本来准备弄图片上去的,还没弄.. pintu.html ? 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

java代码-用java如何编写翻牌小游戏

问题描述 用java如何编写翻牌小游戏 用java编写翻牌小游戏,点击一张牌,它周围的牌都会翻过来,直到完全翻过来,求源代码 解决方案 http://download.csdn.net/detail/qq_21543697/8595769 解决方案二: 如何用java编写小游戏如何用java编写小游戏用JAVA编写小游戏连连看

接苹果游戏-请教接苹果小游戏代码怎么编?(Java)

问题描述 请教接苹果小游戏代码怎么编?(Java) 我编写的是用篮子接小球,在一个面板里既可以控制篮子左右移动,又不妨碍小球随机掉落,小球可以用Timer动画隔一段时间就repaint,篮子通过按钮左右移动之后也要repaint,他们都是通过一个paintComponent画出来的,但是这样一来,小球本来在时间间隔里,但是每次一移动篮子,小球又要重画,这样造成小球移动得时快时慢,这样怎么办??? 下面是我的Java代码: public class FinalProject extends JFr