📄 csdn技术中心 applet射击小游戏开源.htm
字号:
<TD align=right><A
href="http://dev.csdn.net/articlelist.aspx?c=12">网站制作技术</A> (<A
href="http://www.csdn.net/Rss/RssFeed.aspx?rssid=1&bigclassid=12">rss</A>) </TD></TR></TBODY></TABLE>
<TABLE style="MARGIN-BOTTOM: 4px" cellSpacing=0 cellPadding=0
width="95%" align=center border=0>
<TBODY>
<TR>
<TD style="COLOR: #0033ff; BORDER-BOTTOM: #b0c4de 1px dashed"
align=right><FONT style="FONT-SIZE: 8pt">数据库</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/articlelist.aspx?c=8">数据库开发</A> (<A
href="http://www.csdn.net/Rss/RssFeed.aspx?rssid=1&bigclassid=8">rss</A>) </TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center
border=0>
<TBODY>
<TR>
<TD style="COLOR: #0033ff; BORDER-BOTTOM: #b0c4de 1px dashed"
align=right><FONT style="FONT-SIZE: 8pt">软件工程</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/articlelist.aspx?c=13">其他</A> (<A
href="http://www.csdn.net/Rss/RssFeed.aspx?rssid=1&bigclassid=13">rss</A>) </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#000000
border=0><TBODY>
<TR>
<TD vAlign=top bgColor=#ededed>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=right
background="CSDN技术中心 applet射击小游戏开源.files/top.gif"
height=27><FONT
class=fonttitle>积极原创作者 </FONT></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/iwo99">iwo99</A> <FONT
color=#ff0000>(3)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/ZQGet">ZQGet</A> <FONT
color=#ff0000>(10)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/zzok1">zzok1</A> <FONT
color=#ff0000>(1)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/fun1984">fun1984</A> <FONT
color=#ff0000>(3)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/goaler">goaler</A> <FONT
color=#ff0000>(33)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/xuyongfeng">xuyongfeng</A> <FONT
color=#ff0000>(1)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/maxwell2">maxwell2</A> <FONT
color=#ff0000>(2)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/caimouse">caimouse</A> <FONT
color=#ff0000>(21)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/ezerg">ezerg</A> <FONT
color=#ff0000>(29)</FONT></TD></TR>
<TR>
<TD align=right><A
href="http://dev.csdn.net/user/linuxnote">linuxnote</A> <FONT
color=#ff0000>(38)</FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top width=786>
<TABLE cellPadding=4 width="100%" border=0>
<TBODY>
<TR>
<TD width=10 height=19></TD>
<TD height=19>
<TABLE cellSpacing=3 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD><A href="http://www.csdn.net/">CSDN</A> - <A
href="http://dev.csdn.net/">文档中心</A> - <FONT color=#003399><A
id=ArticleTitle1_ArticleTitle1_hlClass
href="http://dev.csdn.net/articlelist.aspx?c=6">Java</A></FONT>
</TD>
<TD align=right>阅读:<SPAN
id=ArticleTitle1_ArticleTitle1_lblReadCount>76</SPAN>
评论: <SPAN
id=ArticleTitle1_ArticleTitle1_lblCommentCount>0</SPAN>
<A
href="http://dev.csdn.net/article/41/41363.shtm#Comment">参与评论</A>
</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=3 cellPadding=3 width="100%" bgColor=#eeeeee
border=0>
<TBODY>
<TR>
<TD noWrap width=60 height=0></TD>
<TD></TD></TR>
<TR>
<TD noWrap align=middle bgColor=#003399 height=16><FONT
color=#ffffff>标题</FONT></TD>
<TD><B> <SPAN
id=ArticleTitle1_ArticleTitle1_lblTitle>applet射击小游戏开源</SPAN></B>
选择自 <A id=ArticleTitle1_ArticleTitle1_AuthorLink
href="http://dev.csdn.net/user/difeijin">difeijin</A> 的 Blog
</TD></TR>
<TR>
<TD align=middle bgColor=#003399 height=16><FONT
color=#ffffff>关键字</FONT></TD>
<TD width=500> <SPAN
id=ArticleTitle1_ArticleTitle1_lblKeywords>applet射击小游戏开源</SPAN></TD></TR>
<TR>
<TD align=middle bgColor=#003399 height=16><FONT
color=#ffffff>出处</FONT></TD>
<TD> <SPAN
id=ArticleTitle1_ArticleTitle1_lblSource></SPAN></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD width=10></TD>
<TD><SPAN id=ArticleContent1_ArticleContent1_lblContent>
<P><FONT
style="BACKGROUND-COLOR: #f1fee7">首先请准备好图像素材,例如把以下图像分别命名为bird.gif
shark.gif 和weed.gif放到源文件同一目录下,<BR><IMG
src="">
<IMG
src="">
<IMG
src=""><BR>bird.gif
shark.gif
weed.gif<BR>大家也可以自己随便指定图像,看代码就知道了<BR>空格开始或暂停 方向键控制方向 f和g为开火两种不同的子弹
z和x为增加横向和纵向的移动速度 player的子弹可以抵消敌人的子弹
更多内容请自己添加修改 <BR>start:<BR>Watergame.java<BR><BR>//小李开源之javagame
by difeijin 2004 10 8<BR>//如有疑问请联系我<BR>//一个横版射击游戏,需要素材为bird.gif,
shark.gif, weed.gif<BR>//bird.gif 为player的图案 shark.gif为enemy的图案
weed为背景草的图案 游戏可以很方便的扩充<BR>//例如添加敌人增强火力增加吃奖励提升战斗能力等<BR>import
java.awt.*;<BR>import java.applet.Applet;<BR>import
java.awt.*;<BR>import java.applet.*;<BR>import
java.lang.*;<BR>import java.util.*;<BR>import java.net.*;</FONT></P>
<P><FONT style="BACKGROUND-COLOR: #f1fee7">//
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //<BR>class shark_fire
implements Runnable
//同一高度有三颗子弹<BR>{<BR> int
startx;<BR> int
starty;<BR> int
xoffset;<BR> int
firespeed;<BR> int
firesize;<BR> int rot;<BR>
int countofexplode;<BR> Thread
myThread;<BR> static int count =
0;<BR> boolean state,
explode;<BR> public
shark_fire()<BR>
{<BR> state =
false;<BR>
count++;<BR>
countofexplode = 0;<BR>
xoffset = 0;</FONT></P>
<P><FONT
style="BACKGROUND-COLOR: #f1fee7">
myThread = null;<BR> }<BR>
public shark_fire(int x, int y, int z, int
size)<BR>
{<BR>
count++;<BR> startx =
x;<BR> starty =
y;<BR> firespeed =
z;<BR> firesize =
size;<BR> myThread =
null;<BR> explode =
false;<BR> state =
true;<BR> countofexplode =
0;<BR> xoffset =
0;<BR>
this.start();<BR> }<BR> public
void set(int x, int y, int z, int size)<BR>
{
//count++;<BR> startx =
x;<BR> starty =
y;<BR> firespeed =
z;<BR> firesize =
size;<BR> explode =
false;<BR> state =
true;<BR> countofexplode =
0;<BR> xoffset =
0;<BR> //
myThread=null;<BR>
this.start();<BR> }<BR> public
void setexplode()<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -