-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied in the game files from brisberg/twine-games
- Loading branch information
Showing
9 changed files
with
255 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Game Name key (for analytics) | ||
window.GAME_NAME = 'journey'; | ||
|
||
// Setup Initial Static Data | ||
setup = { | ||
initialState: { | ||
distance: 100, | ||
hull: 20, | ||
crew: 10, | ||
fuel: 8, | ||
}, | ||
events: [ | ||
'Calm Seas', | ||
'Rough Seas', | ||
'Storm', | ||
'Old Shipwreck', | ||
'Raft', | ||
'Friendly Port', | ||
], | ||
hullMax: 20, | ||
crewMax: 15, | ||
fuelMax: 15, | ||
}; | ||
|
||
// Setup custom functions | ||
window.customPrint = () => { | ||
return 'This is a custom print'; | ||
}; | ||
|
||
window.randomEvent = () => { | ||
const index = Math.floor(Math.random() * setup.events.length); | ||
return setup.events[index]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
id: "journey" | ||
version: "1.0.0" | ||
title: "Journey" | ||
description: "Travel the high seas, overcoming challenges in an Oregon Trail inspired game." | ||
head: | ||
- "shared/analytics/header/analytics.html" | ||
deps: | ||
- "games/journey" | ||
- "shared/analytics/js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
:: Calm Seas | ||
The seas are calm with a slight, salty southernly breeze. Your crew are in good spirits as they unfurl the \ | ||
sails and tend to the rigging. | ||
|
||
You spot a flying fish leap from the water but it is too far to catch. | ||
|
||
|
||
:: Rough Seas | ||
<<set $fuel -= 1>>\ | ||
Strong winds whip the ocean up into a rage. Tall waves crash over the deck, as your crew hurries to secure \ | ||
supplies to the deck and lower the top sails. | ||
|
||
Before your crew is finished, a large wave washes a crate of coal overboard. | ||
|
||
|
||
:: Storm | ||
<<set $crew -= 1>>\ | ||
A violent sea squal approaches rapidly from the north. Your crew rush to stow the sails and take the heavy \ | ||
supplies below deck to ride it out. Rain drenches your face as you try to keep the ship on course. | ||
|
||
Above there is a brillient flash of lightning, followed imediatly by a deafening thunderclap. A crewmen on \ | ||
the rigging loses his footing on the rain slick beams and falls overboard. | ||
|
||
"Man Overboard!" shouts the foreman, as several men try to throw him a line. However, he is quickly swept \ | ||
under by the rolling waves and disappears from sight. | ||
|
||
|
||
:: Old Shipwreck | ||
<<set $fuel += 4>>\ | ||
The Barrelman in the crows nest yells that he spotted a small vessle beached on a sandbar off the starboard side. \ | ||
You bring your ship around and send out a small rowboat to investigate. | ||
|
||
Your men return saying the ship is abandoned and likely been there for several years. However, they recovered \ | ||
several crates of fuel in water-tight barrels so you count your blessing. | ||
|
||
|
||
:: Raft | ||
<<set $crew += 1>>\ | ||
The Barrelman in the crows nest yells that he spotted a small raft on the horizon just ahead. As your ship approach \ | ||
the raft you can make out the body of a man lying motionless across the bamboo raft. | ||
|
||
Your crew hoists the man up, and to your surprise he appears to be alive! Baddly sunburned and dehydrated he \ | ||
can barely thank you before falling unconcious again. | ||
|
||
You send him below decks to recover. A few days and warm meals later his vigor had returned and he pledges \ | ||
service to you for saving his life. | ||
|
||
|
||
:: Friendly Port | ||
<<set $hull += 5>>\ | ||
<<set $fuel += 5>>\ | ||
<<set $crew += 3>>\ | ||
"Land Ho!" shouts the Barrelman, pointing to a dark spot on the horizon ahead. | ||
|
||
Your crew rejoices as you approach a small port town on this remote island. The port is friendly to the empire and \ | ||
your ship is welcomed to the docks. While your crew enjoys some much needed shore-leave, you set about requesting \ | ||
repairs and resupplies for your vessal. | ||
|
||
The workmen work quickly to patch any holes and repair the rigging. Fresh barrels of fuel are brought aboard. Even \ | ||
a few young sailors looking for passage off the island signup to swell your ranks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
:: Launch | ||
Flags fly high, husbands and wives wave from the pier, and bells ring as your vessle, H.M.S Titus, \ | ||
leaves Port Royal on its maiden voyage. | ||
|
||
Your ship is in tip-top shape and the crew is filled with joy and vigor. | ||
|
||
The task ahead of you is a simple but important one: Voyage to Isla De'muerta and deliver much \ | ||
needed supplies and munitions to colony there. | ||
|
||
<<set $event to "Calm Seas">> | ||
[[Embark->Voyage]] | ||
|
||
|
||
:: Voyage [nobr] | ||
You are on your voyage! | ||
<br> | ||
<br> | ||
<<include $event>> | ||
<br> | ||
<br> | ||
|
||
<<if $distance === 10>> | ||
<<set $distance -= 10>> | ||
[[Onward!->Island]] | ||
<<elseif $fuel <= 0>> | ||
[[No Fuel]] | ||
<<elseif $crew <= 0>> | ||
[[No Crew]] | ||
<<elseif $hull <= 0>> | ||
[[No Hull]] | ||
<<else>> | ||
/* Update standard variables for each voyage step */ | ||
<<set $event to randomEvent()>> | ||
<<set $fuel -= 1>> | ||
<<set $distance -= 10>> | ||
[[Onward!->Voyage]] | ||
<</if>> | ||
|
||
|
||
:: Try Again | ||
Your Voyage ends here. | ||
<<link "Try Again?">><<script>>UI.restart()<</script>><</link>> | ||
|
||
|
||
:: No Fuel | ||
Your engines chug to a stop as the last bits of coal are used up. You and your men look around \ | ||
at each other in despair as you realize you will likely starve or freeze before anyone can reach you. | ||
|
||
<<script>>pushEvent('Story', 'Lose', 'No Fuel');<</script>>\ | ||
<<include "Try Again">> | ||
|
||
|
||
:: No Crew | ||
You stand alone, captain of a derelict ship. All of your crew have been swallowed by the Sea \ | ||
(or worse) and you are all that is left. It is impossible to run a ship this size alone. You \ | ||
keep things running as long as you can, but eventually your stamina gives out. | ||
|
||
/* TODO: Add events here. (Hit a sandbar, sunk in a storm, pirates? etc) */\ | ||
Drifting aimlessly at the sea winds' whim, you eventually feel a rough thud as your ship runs in \ | ||
a long forgotten sandbar. The ship is beached permanently and it would take ten men to recover it. | ||
|
||
You feel so very tired. As you drift off to a final slumber, you wonder if another captain will \ | ||
find your ship and make better use of your supplies. | ||
|
||
<<script>>pushEvent('Story', 'Lose', 'No Crew');<</script>>\ | ||
<<include "Try Again">> | ||
|
||
|
||
:: No Hull | ||
Your ship creaks and groans under strain of holding itself together. Numerous gashes and \ | ||
splintered boards dot the lower decks and you have been taking on water for some time. | ||
|
||
Finally the strain is too much and the aft section buckles, pulling the mast down with it. | ||
|
||
"Abbandon ship!" you shout, though it may be too late. Your crew scrambles to lower the \ | ||
dingy and cram aboard. Some leaping to the water to swim for it. | ||
|
||
However, they say a Captain must go down with his ship. You remain aboard, sipping wine \ | ||
as your crew rows into the distance and water slowly fills your cabin. | ||
|
||
<<script>>pushEvent('Story', 'Lose', 'No Hull');<</script>>\ | ||
<<include "Try Again">> | ||
|
||
|
||
:: Island | ||
The sea is calm and the spies clear of clear of clouds. It is as if the sea knew how close \ | ||
you were to journey's end it rewarded you with a brisk southernly wind pushing you onward. | ||
|
||
The Barrelman is the first to spot land on the horizon. | ||
|
||
"Land Ho!", he shouts triumphantly. | ||
|
||
Your navigator double checks his charts and confirms that you have at last arrived at your \ | ||
final destination. Your crew rejoices and breaks out into a merry sea shanty. You can finally \ | ||
relax and feel flush with relief as you stare at the steadily growing island on the horizon. | ||
|
||
[[Dock at Isle De'muerta->Win]] | ||
|
||
|
||
:: Win | ||
You land at Isla De'muerta and are greeted by the Harbormaster. He shakes your hand with much \ | ||
enthusiasm, thanking you for your bravery and service to the Empire. | ||
|
||
Porters begin to unload your ship of it's precious supplies and cargo. | ||
|
||
You are treated to a find dinner in your honor by the Govenor of the island. | ||
|
||
You and your crew enjoy yourself for a time, but soon you feel the sea calling to you again. | ||
|
||
Will you set sail on another <<link "Voyage?">><<script>>UI.restart()<</script>><</link>> | ||
<<script>>pushEvent('Story', 'Win', '');<</script>> |