俄罗斯方块课程设计报告.doc
- 文档编号:566398
- 上传时间:2023-04-29
- 格式:DOC
- 页数:25
- 大小:161KB
俄罗斯方块课程设计报告.doc
《俄罗斯方块课程设计报告.doc》由会员分享,可在线阅读,更多相关《俄罗斯方块课程设计报告.doc(25页珍藏版)》请在冰点文库上搜索。
Inordertoensurenormalteachingorder,protectingstudents'healthygrowth,ensuringthatnational(property)isnotlost,topreventorminimizetheoccurrenceofsafetyaccidents,followthe"prevent,rescueeachother,ensuresafetyandreducelosses"principle,accordingtothelocalconditions,makethemanagementsystem.1,theprincipalistheresponsibilityofschoolsafety,schoolsecurityundertheleadershipofPresidentsecurityworkleadinggroup.Theheadteachertotheleadershipteamisresponsiblefor,implementationoftheaccountabilitysystem.2,schoolmonthlystudentknowledgeaboutsafetyeducation,educationshouldbediversifiedintheformeverysafetyeducationforstudentsofclassesperweekshouldbetargeted.TocarryonemergencyissuesdealingwitheducationinGeneral,self-helpandmutualrescueknowledge.Emergencycalls(suchas110,119,122,120,andsoon)usecommonsenseineducation.3,theestablishmentofmajoraccidentreportingsystem.Schoolstudentsreportmajoraccidentwithinanhourofeducation;studentrunanddisappearancestoreport;reportoftheaccidenttoawrittenreportintriplicate,acorrectionalcentre,apolicestation,atownshippeople'sGovernmentshallnotconcealtheaccident.4week,teachersareondutysystem,establishandimprovetheleadershipvalues;strengthentheeducation,managementofteachingactivitiesinschoolstoensurenormalteachingorder;responsibleforschoolsafetyleadershipalwaysmaintainedclosecontactanddistrictpolicestations,canvassingsupportfromthepolicestationonschoolsafetyandhelp.5,strengtheningteachers'moraleducation,establishadedicatedlove,improvingeducationquality,observethestudents'psychologicalchangesatanytimeandtakepreventivemeasures,nocorporalpunishmentandcovertcorporalpunishmentonstudents,studentoutoftheclassroom,schoolsmaynotbe.6,unitsordepartmentsusestudentStreetpropagandaorparticipateinthecelebrations,aswellasparticipatinginothersocialwork,withoutapprovaloftheCorrectionalCentre,schoolprincipalsconsent,withoutorganization.Withouttheapprovalofrelevantdepartments,mayorganizestudentstoparticipateinfirefighting,disasterreliefandsoon.7,schoolsshouldeducatestudentstoobeytheschoolrulesandregulations,ontime,ontimehometopreventaccidents.8,schooltoschoolinspectionsonaregularbasis,foundhiddenintime,andinseverecases,itishardtoeliminateimmediatelyclosed,andreportedtothelocalpeople'sGovernment,education,andruleoflawsection.9,theschoolshouldalwayschecktheinternalwalls,retainingwalls,ponds,railings,handrails,doors,Windows,staircasesandavarietyofsports,extracurricularactivities,facilitiessuchasfiresafety,infrastructuresecurity,unsafefacilitytoimmediatelyrepairanddemolitiontoensurethatteachersandstudentswork,learn,livevenuesandfacilitiesaresafeandreliable.SongLinXiangLiuJiapingelementaryschoolMarch2016songLinXiangLiuJiapingprimaryschoolfiresafetysystemstoenhancefiresafety,protectionofpublicpropertyandthelifeandpropertysafetyofteachersandstudents,schoolfiresafetyintoday-to-daymanagement,isdevelopingthefollowingfiresafetysystem.1,strengthenfiresafetyeducationofthewholeschool.AccordingtotherequirementsoftheFireServicesAct,sothateveryonehasofkeepingfirecontrolsafety,protectingfirecontrolfacilities,fireprevention,reportsoffire
一、系统概述
1.1现状分析
在个人电脑日益普及的今天,一些有趣的桌面游戏已经成为人们在使用计算机进行工作或学习之余休闲娱乐的首选,而俄罗斯方块游戏是人们最熟悉的小游戏之一,它以其趣味性强,易上手等诸多特点得到了大众的认可,因此开发此游戏软件可满足人们的一些娱乐的需求。
此俄罗斯方块游戏可以为用户提供一个可在普通个人电脑上运行的,界面美观的,易于控制的俄罗斯方块游戏。
1.2项目要求
俄罗斯方块游戏是一款适合大众的游戏软件,它适合不同年龄的人玩。
本软件要实现的功能如下:
(1)游戏区:
玩家可以在游戏区中堆积方块,并能够在游戏过程中随时了解得分情况。
(2)游戏控制:
玩家可以通过游戏控制功能来选择开始新的一局游戏,暂停或退出游戏。
(3)级别设置:
玩家可以根据自己的需要自行设定游戏的开始级别,级别越高,游戏的速度越快,难度越大。
(4)系统功能模块示意图如下:
俄罗斯方块游戏
游戏区
游戏控制
显示玩家操作
显示操作结果
开始
暂停/继续
提高等级
退出
降低等级
二、设计说明
2.1游戏区模块
游戏区模块
创建游戏区
处理玩家游戏操作
显示游戏结果
2.2控制区模块
游戏控制模块
开始游戏
暂停游戏
初始级别设置
退出游戏
2.3系统流程图
是否到顶部
处理玩家操作
开始
设置初始级别
创建游戏区
游戏开局
随机选择方块类型
是否到顶部
方块下落一行
游戏结束
是
否
2.4系统操作界面
游戏打开界面
游戏进行中界面
三、源程序编码
importjavax.swing.*;
importjava.awt.*;
importjavax.swing.border.Border;
importjava.awt.event.*;
publicclassErsBlocksGameextendsJFrame{
publicfinalstaticintalinescore=100;
publicfinalstaticinteverylevelscore=alinescore*20;
publicfinalstaticintmaxlevel=10;
publicfinalstaticintinitlevel=5;
privateGameCanvascanvas;
privateErsBlockblock;
privatebooleanplaying=false;
privateControlPanelctrlPanel;
privateJMenuBarbar=newJMenuBar();
privateJMenu
mGame=newJMenu("游戏"),
mControl=newJMenu("控制"),
mhelp=newJMenu("帮助");
privateJMenuItem
miNewGame=newJMenuItem("新游戏"),
milevelup=newJMenuItem("提高级数"),
mileveldown=newJMenuItem("降低级数"),
miExit=newJMenuItem("退出"),
miPlay=newJMenuItem("开始"),
miPause=newJMenuItem("暂停"),
miResume=newJMenuItem("重新开始"),
miStop=newJMenuItem("停止"),
miCtrlBlock=newJMenuItem("方块控制键");
publicErsBlocksGame(Stringtitle)
{
super(title);
setSize(315,392);
DimensionscrSize=Toolkit.getDefaultToolkit().getScreenSize();
setLocation((scrSize.width-getSize().width)/2,
(scrSize.height-getSize().height)/2);
createMenu();
Containercontainer=getContentPane();
container.setLayout(newBorderLayout(6,0));
canvas=newGameCanvas(20,12);
ctrlPanel=newControlPanel(this);
container.add(canvas,BorderLayout.CENTER);
container.add(ctrlPanel,BorderLayout.EAST);
addWindowListener(newWindowAdapter(){
publicvoidwindowClosing(WindowEventwe){
stopGame();
System.exit(0);
}
});
addComponentListener(newComponentAdapter(){
publicvoidcomponentResized(ComponentEventce){
canvas.fanning();
}
});
show();
canvas.fanning();
}
privatevoidcreateMenu()
{
bar.add(mGame);
bar.add(mControl);
bar.add(mhelp);
mGame.add(miNewGame);
mGame.addSeparator();
mGame.add(milevelup);
mGame.addSeparator();
mGame.add(mileveldown);
mGame.addSeparator();
mGame.add(miExit);
mControl.add(miPlay);
mControl.addSeparator();
mControl.add(miPause);
mControl.addSeparator();
mControl.add(miResume);
mControl.addSeparator();
mControl.add(miStop);
mhelp.add(miCtrlBlock);
setJMenuBar(bar);
miNewGame.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
stopGame();
reset();
setLevel(initlevel);
}
});
mileveldown.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
intcurLevel=getLevel();
if(curLevel>1)
setLevel(curLevel-1);
}
});
milevelup.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
intcurLevel=getLevel();
if(curLevel>1)
setLevel(curLevel+1);
}
});
miExit.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
System.exit(0);
}
});
miPlay.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
playGame();
}
});
miPause.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
pauseGame();
}
});
miResume.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
resumeGame();
}
});
miStop.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
stopGame();
}
});
miCtrlBlock.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
reportGameMethod();
}
});
}
publicvoidreset()
{
ctrlPanel.reset();
canvas.reset();
}
publicbooleanisPlaying()
{
returnplaying;
}
publicErsBlockgetCurBlock()
{
returnblock;
}
publicGameCanvasgetCanvas()
{
returncanvas;
}
publicvoidplayGame()
{
play();
ctrlPanel.setPlayButtonEnable(false);
miPlay.setEnabled(false);
ctrlPanel.requestFocus();
}
publicvoidpauseGame()
{
if(block!
=null)
block.pauseMove();
ctrlPanel.setPauseButtonLabel(false);
miPause.setEnabled(false);
miResume.setEnabled(true);
}
publicvoidresumeGame()
{
if(block!
=null)
block.resumeMove();
ctrlPanel.setPauseButtonLabel(true);
miPause.setEnabled(true);
miResume.setEnabled(false);
ctrlPanel.requestFocus();
}
publicvoidstopGame()
{
playing=false;
if(block!
=null)
block.stopMove();
miPlay.setEnabled(true);
miPause.setEnabled(true);
miResume.setEnabled(false);
ctrlPanel.setPlayButtonEnable(true);
ctrlPanel.setPauseButtonLabel(true);
}
publicintgetLevel()
{
returnctrlPanel.getLevel();
}
publicvoidsetLevel(intlevel)
{
if(level<11&&level>0)ctrlPanel.setLevel(level);
}
publicintgetScore()
{
if(canvas!
=null)
returncanvas.getScore();
return0;
}
publicintgetScoreForLevelUpdate()
{
if(canvas!
=null)
returncanvas.getScoreForLevelUpdate();
return0;
}
publicbooleanlevelUpdate()
{
intcurLevel=getLevel();
if(curLevel { setLevel(curLevel+1); canvas.resetScoreForLevelUpdate(); returntrue; } returnfalse; } privatevoidplay(){ reset(); playing=true; Threadthread=newThread(newGame()); thread.start(); } privatevoidreportGameMethod(){ JOptionPane.showMessageDialog(this,"J为向左移动,L为向右移动,K为加速向下,I为翻转变化");
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 俄罗斯方块 课程设计 报告