matlab problem

i have an assignment where we have to create a game. the user enters a certain launch angle of projectile and a desired speed. a graph has to then be plotted to show the path taken by the projectile.

i have written the code to do that and it works, i have included the ground level in the graph (y=50) and the target you must aim for.

however, the programme must consist of 5 levels. Each level has a differeent value of gravity ( 5 values of g found in the solar system). These levels or values of gravity have to be randomly generated and displayed in the command window.

I so far have a welcome message, then i ask the user to enter an angle and then velocity but it must show something like "level 1 - gravity is 9.81m/s^2)" and then "level 2 - gravity is xym/s^2". Can anyone tell me how to write the code to generate 5 levels which occur in random order as you progress through the game.



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion