Java简单雷电游戏代码

               

完整代码!!!

import java.awt.*;

import java.awt.event.KeyEvent;

import java.awt.event.KeyListener;

import javax.swing.ImageIcon;

import javax.swing.JPanel;

public class Mhh {

public static void main(String args[]){

Frame w=new Frame();

w.setSize(430,500);

MyPanel9 mp=new MyPanel9();

w.add(mp);

w.addKeyListener(mp);

mp.addKeyListener(mp);

Thread t=new Thread(mp);

t.start();

w.show();

}

}

class MyPanel9 extends JPanel implements Runnable,KeyListener

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
重庆大学11级计算机学院JAVA小实验: Project 3:Raiden (雷電) Lite Overview Raiden (雷電,) is a 1990 scrolling shooter arcade game that was developed by Seibu Kaihatsu. The title in Japanese translates to "Thunder And Lightning". Rai means thunder, and den means lightning. "Raiden" is the name of a Japanese WWII Fighter. Raiden consists of eight vertical scrolling missions where the player pilots the "Raiden Supersonic Attack Fighter" through waves of enemies, dodging and destroying enemy buildings, ground targets, and air craft. For this project,you and your team will design and implement a simplified version of raiden game using Java language. Requirements Please read following specifications carefully. You will lose points if you miss any requirement.   The Player can control the Raiden by pressing different key on the keyboard. Four key are used to moving the fighter front, back, left and right respectively in order to avoid attacks of enemies or to target enemies. One key is used to fire a bullet or to launch a missile to attack enemies.   At least two types of weapon- bullet and missile should be supported. The bullet moves in straight line, and can only attack the enemy at front of it while the missile can target an enemy, track it and destroy it. After destroying an enemy aircraft the player can gain certain bonus such as making his weapons stronger, elongating his life or increasing score etc. When the player gained enough scores, the game should come into next stage, in which there are more enemies and the enemies shoot faster. At least two stages should be provided. Of course you can gain higher grade if you provide more advanced function beyond those listed above. Implement tips 1 You will find more useful informations in the following lessons: “Java GUI”, “Java Graphics”, “Applet and Multimedia”. The lesson ‘multithreading ’ maybe is useful to some advanced programmer.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值