Find Jobs
Hire Freelancers

Small Python Game

$30-60 USD

Completed
Posted almost 13 years ago

$30-60 USD

Paid on delivery
Program using Python a small arena where 2 battleBots have to fight. More details in the full descrpition :) PS: helpful info provided ## Deliverables # BattleBot tournaments take place in ferocious futuristic arenas. Each tournament consists of two BattleBots that face each other in duel - there can be only one victor! Battlebots are created according to a points allocation system as follows: POINTS ALLOCATION SYSTEM: A maximum of 6 points overall may be spent on the addition of components and capabilities to each BattleBot. Points cost To buy 1 +1 unit of health (default health level is 1) -1 +1 second of recharge time (default recharge time is 1 second). Up to a maximum of 8 points from recharge time are available. 1 +1 unit of damage (default damage is 1) 1 +1 unit of range (default range is 1) 1 +10% weapon accuracy (default accuracy is 20%) GAME RULES: ? Weapons can only hit BattleBots that are within their range. ? It should only be possible for a BattleBot to fire its weapon if it is recharged. It takes the specified recharge time to recharge a weapon after it is fired. ? The probability of a specific weapon to hit a target within its range is given by the weapon accuracy percentage. ? A successful hit will reduce the health of the attacked BattleBot by the full damage value of the weapon. Create a small BattleBots tournament game, following the guidelines above. In each case, an easier way of achieving the task ("easy street") is suggested in addition to a more advanced way ("rocky road"). (a): Assemble the BattleBot classes In addition to a unique ID and a name, each BattleBot comprise of chassis and weapon details: ? The chassis component of a BattleBot is comprised of a health level, the radius (width) of the BattleBot and its position and angle (orientation) in the arena. A BattleBot is considered terminated (blows up: KABOOOM!) when its health level falls below zero. ? The weapon component is represented by a range value, a damage value, accuracy and recharge time in seconds. ? Some other details you should store are how many victories and defeats this BattleBot has had in the arena. (1) Design a class or set of classes to represent BattleBots and their components on paper, including relevant attributes and method names (you do not have to add their details yet). Separate the classes out over multiple .py files appropriately. Justify your own design decisions in the report. (2) The constructor of each BattleBot should ensure that it fulfils the game rules with respect to the maximum points spend for abilities. (3) Implement the classes enumerated in your design and test them. (4) Initialise five BattleBot instances and print out their stats to test your system. Easy Street: Use a single class to represent the BattleBot and all components. The class may look like: Attributes: [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] Methods: setHealthLevel(self, h) #sets the health level to h reduceHealthLevel(self, h) #reduce health level by h #do something if the BattleBot health < 0 isWeaponReady(self) #check to see if weapon has recharged printStats(self) #print the details of this BattleBot update(self) #update the state of the BattleBot according to some behaviour, essentially to update its position Rocky Road: Each component should be implemented as a separate class, each with its own ID and name. BattleBots may share component types. So, for example, two separate BattleBots may use "Laser1" ID:1, which has a damage of 5, range of 1 and a reload time of 5 seconds. (b): The GUI Create a front-end GUI for the BattleBots game (using TKInter and PYGame for example). The GUI should be contained in appropriate class structure and use controls to provide: Easy Street: (1) An area where the BattleBots will be displayed graphically. (2) Allow the selection of two BattleBots to be placed into the arena. (3) Allow the tournament to commence (i.e. a START button). (4) Display the stats of each BattleBot, e.g. their current health and armour level. (5) Display each BattleBot on the screen at its current position and orientation. Rocky Road: (6) All of the above and... (7) Load in a graphics file and use it to represent the arena floor. (8) A PAUSE button that pauses the game. Clicking on the START button will allow the game to recommence. (9) Display the current behaviour of each of the BattleBots beside their stats e.g. moving to a specific arena location, engaging in combat, firing laser, etc. (c): The Database Create a back-end SQL database (using PYSQLite for example) in an appropriate class structure for storing the details of all the different robots and the game details: Easy Street: (1) Create a single database table for all of the robot details (see Objective (a) previously). In the robot details table, the robot ID will be the primary key. (2) Create a second database table for the game state. This can store some very simple but important details about whether there is a tournament in progress, whether the game is paused and so on. Rocky Road: (3) Use a single database table for the robot details, with the robot ID as the primary key. However, separate out the weapon details into a second table. The weapon ID should be a primary key in the weapon details table, and a foreign key in the robot details table. (d): The Game Logic Implement the game logic. This will call the methods you defined for your BattleBot and interface between the classes. Easy Street: (1) Detect the end of the game (it happens when one of the BattleBots health values is reduced below zero) and adjust victories/defeats as necessary. Display a message declaring the winner and end of game. Rocky Road: (2) The above, and... (3) Implement the main game rules (see page 1). (4) Create and automated arena where pairs of predefined BattleBots fight with each other. After 100 duels each, produce a BattleMegaBot. The BattleMegaBot is simply the mix of parameters (health, weaponRange, etc) that have been the most successful within your own arena.
Project ID: 3462336

About the project

1 proposal
Remote project
Active 13 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$51 USD in 9 days
5.0 (2 reviews)
2.0
2.0

About the client

Flag of UNITED KINGDOM
United Kingdom
5.0
2
Member since Aug 10, 2010

Client Verification

Other jobs from this client

Game Lobby Python
$30-60 USD
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.