BTH000留学生作业代做、Python编程语言作业调试、Python实验作业代写、代做turtle race作业代做Processing|帮做Java程序

Assignment 2 – Object oriented turtle raceCourse: BTH000 Python Programming I1 IntroductionThe purpose of the assignment is for you to demonstrate that you grasp thebasics in object oriented modeling and that you master to put together aPython program with a few user defined classes and objects.2 Task –Turtle RaceThe task is to implement a game where a couple of people can register forthe race by inputting their name and their favourite color. Thereafter eachplayer get a turtle with the chosen color, and the turtles compete against eachother in a race from a start line to a goal line. Use the turtle graphics packageto make the turtles and the race track visible on the screen. Use the objectoriented concept to design your program. You shall implement at least twodifferent classes in this assignment. One for the player and one for the racegame itself.This is what a run of the race might look like:Figure 1: Game setup1Figure 2: Game runningFigure 3: Present result2.1 class PlayerYour Player class should at least have the following private attributes: a name a color a start position a Turtle object initiated to the chosen color and correct start positionYou are free to add more attributes if you need to. You could for examplehave a variable with a number keeping track of if the moving method shouldactually move the turtle forward. We do not want it to keep moving out ofthe window after it reached the goal line. If you choose to implement such anattribute it will probably be convenient to implement a getter method correspondingto the attribute. The class should also have a class variable to keeptrack of how many players that have registered to the game so far. This classvariable can be used to calculate the start position for the current turtle whencreating a new Player object.2The constructor shall take two input parameters, the name and the color.At least methods for the following shall be implemented within the class: a method to move the turtle forward a random amount of pixels a getter method that returns the name a getter method that returns the color a method writing the name in text beside the start position2.2 class GameYour Game class should at least have the following private attributes: a list with the players a list representing the game result (can also be a list with players orderedafter race outcome)At least methods for the following shall be implemented within the class: a method that draws the race track on the screen (a start line and a goalline) a method that registers the players (take name and color as interactiveinput, create player object and add to the player list ) a method checking if the race is over (all turtles have stopped) the race itself, i.e. moving the players repeatedly until the race is over a method presenting a list of the race result2.3 Race trackConstants defining the race track bounds may be defined globally and knownby all classes and methods/functions.2.4 Script to run the raceWrite a script that creates a Game object and calls its registering method, racemethod and result presenting method.32.5 Turtle graphicsThe following methods within the turtle package can be useful. There is a fulldescription of all turtle methods on python.org:https://docs.python.org/3.3/library/turtle.html?highlight=turtle.forward(distance)Move the turtle forward by the specified distance, in the direction the turtleis headed.Parameters:distance – a number (integer or float)left(angle)Turn turtle left by angle degrees.right(angle)Turn turtle right by angle degrees.setpos(x, y=None)Move turtle to an absolute position.Parameters:x - a number or a pair/vector of numbers,y - a number or Nonexcor()Return the turtle’s x coordinate.pendown()Pull the pen down – drawing when moving.penup()Pull the pen up – no drawing when moving.color(name)Among other things it sets the turtle color to the one specified by name.Parameters:name – a string which is a valid color name. Valid color names can be foundhere: http://www.science.smith.edu/dftwiki/index.php/Color Charts for TKinter4write(arg)Write text - the string representation of arg- at the current turtle positionaccording to align (’left’, ’center’ or ’right’)hideturtle()Make the turtle invisible.showturtle()Make the turtle visible.shape(name=None)Set turtle shape to shape with given name.Parameters:name – a string which is a valid shape name. Valid shape names are: ’turtle’,’arrow’, ’circle’, ’square’, ’triangle’, ’classic’5本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(BTH000留学生作业代做、Python编程语言作业调试、Python实验作业代写、代做turtle race作业代做Processing|帮做Java程序)