1、Wonderful frog game1Anan An Sep.2016simple introduction :A racquet, represented as a short line segment, can be moved to and fro across the bottom of the window by key presses or by mouse dragging.Frogs would move in the window with a random speed and direction.Each frog bounces off the top, left an
2、d right edges of the window, and off the racquet at the bottom. A frog misses the racquet at the bottom is lost.The frogs bounce each other when they collide.2game introduction :The player scores a point every time when frogs hit the top of the windows .All frogs lost off the bottom of the window, t
3、he game is end.34FrogImagerectlefttopspeedStatus_init_ ()move ()ReflectorImagerectlefttopspeedstatus_init_ ()move ()MainFrameplay() animateplayerspygame.sprite.SpriteScoreMoniterpointsscore_textClass Hierarchymyplayer.py5v base class: pygame.sprite.Sprite: simple base class for visible game objects.
4、v Methods: animate (): animation function ,Collision Detection,build panel, frog and scoring in screen. play (): game startv Class Frog: Define frog classvariables: image:the image of a frog.rect:the rectangle size of a frog imageleft: the left coordinate of a frog rectangle top:the top coordinate o
5、f a frog rectangle speed:the moving speed and direction of a frogstatus:the moving status of a frog methods: _init_():initial a frog move():move a frogv Class Reflector: Define Reflector classvariables: image:the image of a reflector.rect:the rectangle size of a reflector imageleft: the left coordin
6、ate of a reflector rectangle top:the top coordinate of a reflector rectangle speed:the moving speed and direction of a reflectorstatus:the moving status of a reflector methods: _init_():initial a reflector move():move a reflectorTest case for Frog classTechnical: start the game, frogs are created an
7、d moved automatically Code coverage: play, ball, animate8MethodsDescriptionInput Expected outputActual output_init_()Check if the frog shows correctly when initial the game imageFile & location &SpeedThe frog appears in the settled location of screenThe frog appears in the settled location of screen
8、 move()Move a frogA frog can move with random direction and speedA frog can move with random direction and speedTest case for Reflector classTechnical: start the game, racquet created and moved by mouse dragging or key presses.Code coverage: play, ball, animate9MethodsDescriptionInput Expected outpu
9、tActual output_init_()Check if the reflector shows correctly when initial the game imageFile & location &SpeedThe reflectorappears at the bottom of screenThe reflectorappears at the bottom of screen move()Move a reflectorA reflectorcan move with fixed speedA reflectorcan movewith fixed speed10Linear
10、 regression by PythonEntry No.Square FeetPrice11506450220074503250845043009450535011450640015450760018450PREDICTING HOUSE PRICESWe have the following dataset and core codes:Withlinearregression,weknowthatwehavetofindalinearitywithinthedatasowecanget0and1Ourhypothesisequationlookslikethis:11Result12PredictwhichofthefollowingtwoserieswillhaveawideraudienceWe have the following dataset:1314Result15 thanks
侵权处理QQ:3464097650--上传资料QQ:3464097650
【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。