回 帖 发 新 帖 刷新版面

主题:Enmergency help about matlab

Could everyone help me to make these two programs,please? thanks!

[b]Design a game similar to that of Scorched Earth.[/b]Figure 1: A screen shot of the classic computer game Scorched Earth. Tanks take turns at firing at each other until they have lost all their armour at which point they lose the game. In this assignment,the ground will be flat but the rest of the principles will be similar.
2 The game is for 2 people .The aim is to annihilate the other person. The arena will be a two dimensional graph where the x-axis will act as the ground and the y-axis will reach the skies. The arena should be a closed place i.e. there is a maximum x and y coordinate. The ground will be between a length of 500 to 3000m (i.e. 500m ≤ xmax ≤ 3000m) but on screen it should be scaled to lie between 0 and 1. This means that your program will arbitrarily assign a number lying in the above range to be the length of the ground. This number will be different for each new run of the program. Same is to be applied for the y coordinate but the range will be 500 to 1000m.
In the beginning the two players will be randomly placed on the ground. The players will always stay on the ground. Their initial x-coordinates (at the start of the game) will be random. Bombs will be used to destroy the opponent. A player can fire a bomb at his/her opponent by specifying the initial angle and initial speed for each shot. From these initial values, its trajectory or path followed should be calculated using Newton’s laws and plotted.The bomb should explode after hitting the ground. The bomb can have a maximum initial speed of 200m.s−1.A direct hit gives the player an instant victory. However if the bomb explodes somewhere in the opponents vicinity then his/her power points decrease. Initially both players will have
100 power points. For a hit the power decreases as follows:
• In a radius of 10m - 50points
&#8226; A radius > 10 but < 50 - 20points
&#8226; A radius >= 50 but < 100 - 10points
&#8226; Elsewhere - 0
If the bomb hits the maximum x or y coordinate it explodes on the spot. In other words if the bomb tries to go out of the arena then it is destroyed on the boundaries.After each bombing the bomber will be pushed back a certain distance as per the conservation of linear momentum. The constant deceleration provided by the friction of the ground is 20m.s&#8722;2.
The mass of the bomb is 10kg and that of the player is 100kg. If the bomber reaches the max or min x-coordinate then he/she is again randomly placed somewhere on the x-axis.
The trajectories of the bombs of the two players should be displayed with two colours: one colour for each player. The current trajectory of a player should remain on the graph until that same player has had his/her next turn. The players should be represented as small colored dots.
Your program should ask for inputs alternatively from the two players.
Optional:
&#8226; To make work for the players easier, you can write a small bit of code that will calculate
range, max height, etc. for them for given initial angle and velocity so that they don’t
have to reach for their calculators every time.
&#8226; Weather conditions may be included... wind may effect the trajectory of the bomb, large
storms (cyclones, lightning,...) may decrease power points.
&#8226; Different weapons may be used which cause different types of damage
&#8226; Different armour could be used which protect the player from different weapons.

回复列表 (共1个回复)

沙发

可有偿提供代码解决方案

我来回复

您尚未登录,请登录后再回复。点此登录或注册