讲解CS300留学生、讲解SpaceHunt、辅导Java编程语言、辅导Java

- 首页 >> Java编程


CS300 Project Assignment

You have been tasked to work with your group to partially implement the SpaceHunt adventure

game described on the next few pages.

You will receive a Sprint plan from the Instructor approximately every two weeks. Only work on

stories in the current Sprint plan. Stories not in the Sprint plan will not be considered during the

Sprint Reviews. At the end of each Sprint your team will participate in a Sprint Review and

Retrospective.

Inconsistencies between the Stories in the Sprint plan and the interviews defer to the Sprint

plan.

Each story in the Sprint plan must have identifiable contributors. Each team member is

expected to make a meaningful contribution to one or more stories during each Sprint.

Your code must reside in a GitHub repository. It may need to be a public repository so your

entire team can serve as collaborators. The game must be implemented using raw JavaScript.

No frameworks may be used. The final game must be hosted on one of the team member’s CS

accounts for general access.

At the end of each Sprint, each team must submit a contributor’s sheet that identifies each

story, the code that comprises that story and who worked on that code. This must be consistent

with commit logs for your GitHub project.

Page 2 of 4

SpaceHunt: A space-based role playing game for one player.

In SpaceHunt, the player commands the Galactic Schooner, OldSpice. The goal of the game is to locate

the ancient recipe for Koca-Kola which was stolen by BadMax and his interstellar gang of henchmen, and

hidden on an unknown planet in the Pentium System. While it is unknown which of Pentium’s seven

planets (Pentium-1 through Pentium-7) holds the secret recipe, the strong box containing the prize is

fitted with a transmitter that sends out a beacon. This beacon can be detected aboard OldSpice when it

is within orbital distance of the planet.

As the Captain of the good Galactic Schooner OldSpice, you may steer the vessel using units of 30

degrees (0, 30, 60, 90, 120, …, 330) across a two-dimensional plane.

While theoretically, this plane can extend to infinity, for purposes of

the game, it will be limited to 1282

celestial points (CP) with each

being identified by an x and y position. These will be (1,1) to

(127,127). Spacecraft travel from one CP to another, so if the

OldSpice is at CP (20,30) and moves one CP zero degrees they’ll end

up at CP (21,30). Likewise, if the OldSpice then moves one CP 270

degrees, it would end up at CP (21,29). If you want to know which CP

you end up in if you move 60 degrees, google (Cosine,Sine) and review your trigonometry.

Depending on the efficiency of the engine, a spacecraft can consume between one and ten units of

energy for each CP it moves. At the beginning of the game, the OldSpice is fitted with a highly inefficient

Shyster-Quack drive that consumes 10 units of energy per CP traveled. However, there are opportunities

during the game for the OldSpice to be upgraded (at a price!) to more efficient propulsion systems. If

the ship ever runs out of energy, it drifts in space, the crew dies and the game is over.

It takes one turn to enter the direction and distance.

If you encounter a planet, you may land on it and do business with the inhabitants. You may also scan

for the transmitter signal sent out by the strong box when you are in orbit. It takes one turn to enter

orbit, one turn to land, one turn to take off and one turn to leave orbit. It also takes one turn to check

for the transmitter signal, should you choose to do so. Landing on asteroids or docking with space

stations do not require entering orbit, so it is only one turn to land and one turn to take off.

Each turn will consume 2% of the ship’s supplies. If the ship’s supplies ever reach zero, the crew dies and

the game is over.

When the game begins, the OldSpice is docked at CP (0,0), on the inner moon of the planet Eniac. Its

energy pods have just been topped off giving you 1,000 units of energy, and the supplies have been

stocked at 100%. You’ve been advanced 1,000 Digital Credits by the Koca-Kola Company to find the

Page 3 of 4

secret recipe. Once you find it and safely return it to their marketing department on Eniac, you’ll be paid

a reward of a zillion Credits … and you win the game.

During your search, you may buy additional energy if you encounter a Musk-Tesla energy station along

the way. Depending on the spot market, units of energy may differ from station to station. Many times

(but not always) these energy stations have mini-marts associated with them where you can top off your

supplies. Some of these stations also include repair depots that can repair damage and do upgrades.

Both the supplies as well as the repair/upgrade prices have been standardized across the Musk-Tesla

line of service centers, so supplies, repairs and upgrades cost the same at every station.

In addition to being able to upgrade to the more efficient DeNiro (5 units of energy per CP) or the even

more efficient Mucho-DeNiro (1 unit of energy per CP) propulsion systems at repair depots, you can also

purchase auxiliary energy pods that allow the OldSpice to take on an additional 500 units of energy over

its standard capacity of 1,000; an enhanced celestial body sensor, or fuzzy dice for the bridge.

Along the way, you can pick up some extra Credits by hauling freight from one planet to another while

you are searching for the Pentium System.

The Pentium System is uncharted on current celestial maps, so you have no idea where it might lie

within the 128x128 CP game plane. However, you do have a partial “celestial map” that identifies the

location of the following celestial bodies (a celestial body is completely contained within a single CP):

Planet Celeron. Celeron is home to a Musk-Tesla service center/repair depot/mini-mart as well as a

number of traders that are always on the lookout for cargo ships that can transport their merchandise.

You can negotiate a contract and load your ship in one turn. It takes one turn to unload your ship when

you reach your destination.

Planet Xeon. Xeon trades a great deal with Celeron, and you can often get a transport gig between the

two planets. It has a Musk-Tesla franchise with a repair depot.

Planet Ryzen. Ryzen is a backward cesspool of thieves and bandits. However, they pay (really) good

money for cargo “redirected” to them by merchant ships that “lose their way” between Celeron and

Xeon. No Musk-Tesla franchise is on Ryzen, but you can pay inflated prices for energy and supplies if you

absolutely need them. However, if you “redirect” cargo this way, no one will hire you to transport

merchandise again during the current gaming session.

At any given location, you can deploy your sensors. This takes one turn and they will identify “celestial

artifacts” (planets, asteroids, space stations) within two CP in every direction from your ship. You can

(for a price!) have an enhanced sensor system added at a service depot that will detect out to five CP in

every direction. When a celestial artifact is identified, its location should be added to your celestial map.

Page 4 of 4

During your voyage, the following events could occur:

BadMax and his Henchmen attack your ship with the following outcomes: (1) you fight them off;

(2) they blow up your ship, killing everyone aboard and the game is over; (3) they board your

ship, steal all of your credits and half of your supplies.

You encounter a meteor storm and your ship is damaged.

You encounter an abandoned freighter drifting in space and you take on its supplies and energy.

Your path takes you through a CP containing a celestial artifact. This results in a collision that

may either damage your ship (in which case, it needs to be repaired) or destroys it in which case

the crew dies and the game is over.

You encounter a Casinian while at a Space Station and may optionally participate in a game of

chance, either losing or gaining Credits.

In the event your ship is damaged, it is still navigable, but it consumes energy at 5 times its usual rate, so

it is important to get it to a repair depot as soon as possible.

At certain places, “worm holes” exist that will take your ship from one point to another, many CPs

distant, in one move while consuming a single unit of energy. The 128x128 play area is surrounded by

worm holes (i.e., if you move off the map, a worm hole will drop you back into the map at a random

location). For instance, if you move to CP (0,26), you’ll be sent to another random location, like CP

(10,15), for example. Worm holes may also exist within the play area.

Fuzzy Dice are magic and may mitigate some damage if you own a pair.

You should be able to leave the game and return to where you left off.

You should be able to design and load alternate celestial maps, as well as being able to set parameters

such as the cost of items and services.




站长地图