Compare commits

...

10 Commits

Author SHA1 Message Date
1873b4671e Added thingas 2021-02-26 22:54:51 -06:00
KindaCrappyGames
7b8a502ef3 Create README.md 2020-04-04 18:39:54 -05:00
Tom Tibble
66b6e68cee fixed gitignore 2020-04-04 18:19:08 -05:00
Tom Tibble
7b67148e30 added gitignore 2020-04-04 18:11:28 -05:00
Tom Tibble
1f614c5652 added scoreboard hotkey 2020-04-04 18:04:30 -05:00
Tom Tibble
33ed5ec6b0 added scoreboard 2020-04-04 18:00:39 -05:00
Tom Tibble
a7683b519e refactored, reorganized, and state change to loop back to beginning after race. 2020-04-04 16:58:20 -05:00
d6df811a48 some extra stuff, not suepr sure.... 2019-11-17 15:58:23 -06:00
1161eb1c1f added some stuff idr what. 2019-07-28 20:30:51 -05:00
02ab548838 added horseybois 2019-07-26 22:39:51 -05:00
31 changed files with 4148 additions and 4358 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.idea/*

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4"> <module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" /> <excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" /> <excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" /> <excludeFolder url="file://$MODULE_DIR$/tmp" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

10
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" /> <option name="languageLevel" value="ES6" />
</component> </component>
</project> </project>

14
.idea/modules.xml generated
View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HorseRaceGame.iml" filepath="$PROJECT_DIR$/.idea/HorseRaceGame.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/HorseRaceGame.iml" filepath="$PROJECT_DIR$/.idea/HorseRaceGame.iml" />
</modules> </modules>
</component> </component>
</project> </project>

10
.idea/vcs.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
</component> </component>
</project> </project>

375
.idea/workspace.xml generated
View File

@@ -1,375 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="d9dac41b-fc54-4ab0-93ea-73586523c969" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
<ignored path="$PROJECT_DIR$/tmp/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="225">
<file leaf-file-name="index.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="15" column="40" selection-start-line="15" selection-start-column="40" selection-end-line="15" selection-end-column="40" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="audio.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/audio.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="319">
<caret line="176" column="11" selection-start-line="176" selection-start-column="11" selection-end-line="176" selection-end-column="11" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="game.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/game.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-4603">
<caret line="15" column="44" selection-start-line="15" selection-start-column="42" selection-end-line="15" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="a_horse.png" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/a_horse.png">
<provider selected="true" editor-type-id="images" />
</entry>
</file>
<file leaf-file-name="horse_san_69.png" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/horse_san_69.png">
<provider selected="true" editor-type-id="images" />
</entry>
</file>
<file leaf-file-name="CrotchRocket_93_raw.png" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/CrotchRocket_93_raw.png">
<provider selected="true" editor-type-id="images" />
</entry>
</file>
<file leaf-file-name="DEMON_HORZE_666.png" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/DEMON_HORZE_666.png">
<provider selected="true" editor-type-id="images" />
</entry>
</file>
<file leaf-file-name="stonewall_000.png" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/stonewall_000.png">
<provider selected="true" editor-type-id="images" />
</entry>
</file>
<file leaf-file-name="BlackJack_10.png" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/BlackJack_10.png">
<provider selected="true" editor-type-id="images" />
</entry>
</file>
<file leaf-file-name="background.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/background.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2674">
<caret line="191" column="84" selection-start-line="191" selection-start-column="84" selection-end-line="191" selection-end-column="84" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="JavaScript File" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>shadow</find>
<find>swaypatter</find>
<find>math.</find>
<find>random</find>
<find>var</find>
<find>play</find>
<find>startcountdown</find>
<find>changeposition</find>
<find>runrace</find>
<find>countdown</find>
<find>horse_image_ar</find>
<find>drawracebackground</find>
<find>inithorses</find>
<find>horse_Array</find>
<find>line</find>
<find>finished</find>
<find>drawcountdown</find>
<find>coun</find>
<find>horseheigh</find>
<find>ctx.</find>
<find>finalplaces</find>
<find>canvas</find>
<find>rect</find>
<find>prerace</find>
<find>horses</find>
<find>owner</find>
<find>inithorse</find>
<find>draw</find>
<find>final results</find>
<find>draw horses</find>
</findStrings>
<replaceStrings>
<replace>cyclesRemaining</replace>
<replace>const</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/resources/background.js" />
<option value="$PROJECT_DIR$/main.css" />
<option value="$PROJECT_DIR$/audio.js" />
<option value="$PROJECT_DIR$/game.js" />
<option value="$PROJECT_DIR$/index.html" />
<option value="$PROJECT_DIR$/background.js" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-1367" />
<option name="y" value="-17" />
<option name="width" value="1368" />
<option name="height" value="786" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="HorseRaceGame" type="b2602c69:ProjectViewProjectNode" />
<item name="HorseRaceGame" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="HorseRaceGame" type="b2602c69:ProjectViewProjectNode" />
<item name="HorseRaceGame" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="HorseRaceGame" type="b2602c69:ProjectViewProjectNode" />
<item name="HorseRaceGame" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="horse_images" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="HorseRaceGame" type="b2602c69:ProjectViewProjectNode" />
<item name="HorseRaceGame" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="horse_images" type="462c0819:PsiDirectoryNode" />
<item name="final" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration name="index.html" type="JavascriptDebugType" factoryName="JavaScript Debug" temporary="true" nameIsGenerated="true" uri="http://localhost:63342/HorseRaceGame/index.html" />
<recent_temporary>
<list>
<item itemvalue="JavaScript Debug.index.html" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="d9dac41b-fc54-4ab0-93ea-73586523c969" name="Default" comment="" />
<created>1562211281380</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1562211281380</updated>
<workItem from="1562211282530" duration="37792000" />
<workItem from="1563080090211" duration="22896000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="60688000" />
</component>
<component name="ToolWindowManager">
<frame x="-1" y="-17" width="1368" height="786" extended-state="6" />
<layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2108389" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info active="true" anchor="bottom" id="Terminal" order="7" visible="true" weight="0.32882884" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Find" order="1" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="1" />
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="196">
<caret line="14" column="23" lean-forward="true" selection-start-line="14" selection-start-column="23" selection-end-line="14" selection-end-column="23" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/main.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="280">
<caret line="20" column="15" selection-start-line="20" selection-start-column="15" selection-end-line="20" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/CrotchRocket_93_raw.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/DEMON_HORZE_666.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/stonewall_000.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/BlackJack_10.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/background.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="868">
<caret line="62" column="48" selection-start-line="62" selection-start-column="21" selection-end-line="62" selection-end-column="48" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/game.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1764">
<caret line="126" column="29" lean-forward="true" selection-start-line="126" selection-start-column="29" selection-end-line="126" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/main.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="280">
<caret line="20" column="15" selection-start-line="20" selection-start-column="15" selection-end-line="20" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/DEMON_HORZE_666.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/CrotchRocket_93_raw.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/stonewall_000.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/audio.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="319">
<caret line="176" column="11" selection-start-line="176" selection-start-column="11" selection-end-line="176" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/BlackJack_10.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="15" column="40" selection-start-line="15" selection-start-column="40" selection-end-line="15" selection-end-column="40" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/horse_san_69.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/game.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-4603">
<caret line="15" column="44" selection-start-line="15" selection-start-column="42" selection-end-line="15" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/horse_images/final/a_horse.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/background.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2674">
<caret line="191" column="84" selection-start-line="191" selection-start-column="84" selection-end-line="191" selection-end-column="84" />
</state>
</provider>
</entry>
</component>
</project>

5
README.md Normal file
View File

@@ -0,0 +1,5 @@
# CrivitzDerby
A crappy game.
https://kindacrappygames.github.io/CrivitzDerby/

354
audio.js
View File

@@ -1,178 +1,178 @@
// this should load all of the effects into memory. // this should load all of the effects into memory.
// Neighs, random horse noises // Neighs, random horse noises
const effects = [ const effects = [
new Howl({ new Howl({
src:['resources/audio/neighs/418428__soundslikewillem__neighing-horse.wav'] src:['resources/audio/neighs/418428__soundslikewillem__neighing-horse.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/neighs/61605__andune__schnauf.wav'] src:['resources/audio/neighs/61605__andune__schnauf.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/neighs/418427__soundslikewillem__snorting-horse.wav'] src:['resources/audio/neighs/418427__soundslikewillem__snorting-horse.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/neighs/53261__stomachache__horse.wav'] src:['resources/audio/neighs/53261__stomachache__horse.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/neighs/448090__breviceps__theremin-horse.wav'] src:['resources/audio/neighs/448090__breviceps__theremin-horse.wav']
}) })
]; ];
// starter guns // starter guns
const gunshots = [ const gunshots = [
new Howl({ new Howl({
src:['resources/audio/starter_guns/145206__lensflare8642__m16-gun-3-round-burst.mp3'] src:['resources/audio/starter_guns/145206__lensflare8642__m16-gun-3-round-burst.mp3']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/170417__eelke__bang-03-clean.mp3'] src:['resources/audio/starter_guns/170417__eelke__bang-03-clean.mp3']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/200245__noah-fletcher__homeade-gun-shot1-no-echo.wav'] src:['resources/audio/starter_guns/200245__noah-fletcher__homeade-gun-shot1-no-echo.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/244394__werra__bang-explosion-metallic.wav'] src:['resources/audio/starter_guns/244394__werra__bang-explosion-metallic.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/244587__timbre__a-synthetic-bang.wav'] src:['resources/audio/starter_guns/244587__timbre__a-synthetic-bang.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/344142__brokenphono__gunshot-002.wav'] src:['resources/audio/starter_guns/344142__brokenphono__gunshot-002.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/347591__nicjonesaudio__assault-rifle-1.wav'] src:['resources/audio/starter_guns/347591__nicjonesaudio__assault-rifle-1.wav']
}), }),
new Howl({ new Howl({
src:['/home/tibz/Dev/HorseRaceGame/resources/audio/starter_guns/362652__trngle__cat-meow(1).wav'] src:['resources/audio/starter_guns/362652__trngle__cat-meow(1).wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/382735__schots__gun-shot.aiff'] src:['resources/audio/starter_guns/382735__schots__gun-shot.aiff']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/391965__ssierra1202__wood-bang.wav'] src:['resources/audio/starter_guns/391965__ssierra1202__wood-bang.wav']
}), }),
new Howl({ new Howl({
src:['resources/audio/starter_guns/474094__piotr123__bang.wav'] src:['resources/audio/starter_guns/474094__piotr123__bang.wav']
}) })
]; ];
const five = [ const five = [
new Howl({ new Howl({
src:['resources/audio/countdowns/five.wav'] src:['resources/audio/countdowns/five.wav']
}), }),
]; ];
const four = [ const four = [
new Howl({ new Howl({
src:['resources/audio/countdowns/four.wav'] src:['resources/audio/countdowns/four.wav']
}), }),
]; ];
const three = [ const three = [
new Howl({ new Howl({
src:['resources/audio/countdowns/three.wav'] src:['resources/audio/countdowns/three.wav']
}), }),
]; ];
const two = [ const two = [
new Howl({ new Howl({
src:['resources/audio/countdowns/two.wav'] src:['resources/audio/countdowns/two.wav']
}), }),
]; ];
const one = [ const one = [
new Howl({ new Howl({
src:['resources/audio/countdowns/one.wav'] src:['resources/audio/countdowns/one.wav']
}), }),
]; ];
// gallops // gallops
const gallops = [ const gallops = [
new Howl({ new Howl({
src:['resources/audio/gallops/322448__deadxcreed__horse-gallop-loop.wav'], src:['resources/audio/gallops/322448__deadxcreed__horse-gallop-loop.wav'],
loop: true loop: true
}), }),
new Howl({ new Howl({
src:['resources/audio/gallops/106896__robinhood76__02234-fake-horse-steps.wav'], src:['resources/audio/gallops/106896__robinhood76__02234-fake-horse-steps.wav'],
loop: true loop: true
}), }),
]; ];
const fanfare = [ const fanfare = [
new Howl({ new Howl({
src:['resources/audio/fanfare/100422__robinhood76__01851-cartoon-fanfare.wav'], src:['resources/audio/fanfare/100422__robinhood76__01851-cartoon-fanfare.wav'],
}), }),
new Howl({ new Howl({
src:['resources/audio/fanfare/198874__bone666138__fanfare.wav'], src:['resources/audio/fanfare/198874__bone666138__fanfare.wav'],
}), }),
new Howl({ new Howl({
src:['resources/audio/fanfare/321937__pel2na__two-kazoo-fanfare.wav'], src:['resources/audio/fanfare/321937__pel2na__two-kazoo-fanfare.wav'],
}), }),
new Howl({ new Howl({
src:['resources/audio/fanfare/413204__joepayne__clean-trumpet-fanfare-with-wobble.mp3'], src:['resources/audio/fanfare/413204__joepayne__clean-trumpet-fanfare-with-wobble.mp3'],
}), }),
new Howl({ new Howl({
src:['resources/audio/fanfare/418526__audeption__fasching-fanfare-karnevals-tusch-tataa-long.wav'], src:['resources/audio/fanfare/418526__audeption__fasching-fanfare-karnevals-tusch-tataa-long.wav'],
}), }),
new Howl({ new Howl({
src:['resources/audio/fanfare/470083__sheyvan__music-orchestral-victory-fanfare.wav'], src:['resources/audio/fanfare/470083__sheyvan__music-orchestral-victory-fanfare.wav'],
}), }),
]; ];
function playRandomNeigh(){ function playRandomNeigh(){
const index = Math.floor(Math.random() * effects.length); const index = Math.floor(Math.random() * effects.length);
effects[index].play(); effects[index].play();
} }
// function starterGun(){ // function starterGun(){
// const index = Math.floor(Math.random() * gunshots.length); // const index = Math.floor(Math.random() * gunshots.length);
// gunshots[index].play(); // gunshots[index].play();
// } // }
function playCountdownAudio(seconds){ function playCountdownAudio(seconds){
let index; let index;
switch (seconds) { switch (seconds) {
case 5: case 5:
index = Math.floor(Math.random() * five.length); index = Math.floor(Math.random() * five.length);
five[index].play(); five[index].play();
break; break;
case 4: case 4:
index = Math.floor(Math.random() * four.length); index = Math.floor(Math.random() * four.length);
four[index].play(); four[index].play();
break; break;
case 3: case 3:
index = Math.floor(Math.random() * three.length); index = Math.floor(Math.random() * three.length);
three[index].play(); three[index].play();
break; break;
case 2: case 2:
index = Math.floor(Math.random() * two.length); index = Math.floor(Math.random() * two.length);
two[index].play(); two[index].play();
break; break;
case 1: case 1:
index = Math.floor(Math.random() * one.length); index = Math.floor(Math.random() * one.length);
one[index].play(); one[index].play();
break; break;
case 0: case 0:
index = Math.floor(Math.random() * gunshots.length); index = Math.floor(Math.random() * gunshots.length);
gunshots[index].play(); gunshots[index].play();
startGallop(); startGallop();
break; break;
} }
} }
function startGallop(){ function startGallop(){
gallops[0].play(); gallops[0].play();
gallops[1].play(); gallops[1].play();
} }
function stopGallop(){ function stopGallop(){
gallops[0].stop(); gallops[0].stop();
gallops[1].stop(); gallops[1].stop();
} }
function playFanfare(){ function playFanfare(){
const index = Math.floor(Math.random() * fanfare.length); const index = Math.floor(Math.random() * fanfare.length);
fanfare[index].play(); fanfare[index].play();
} }

View File

@@ -1,203 +1,217 @@
const fencePostGap = 200; const fencePostGap = 200;
let fenceOffset = fencePostGap; const finishLineSpeed = 7;
let finishLinePosition = -1000; let fenceOffset = fencePostGap;
const finishLineSpeed = 7;
let finishLineDrawn = false; let finishLinePosition = -1000;
let finishLineDrawn = false;
let showWinnerText = true;
let winnerTextCounter = 0; let showWinnerText = true;
let winnerTextCounter = 0;
function drawRaceBackground(ctx, width, height, horseSize, cyclesRemaining, isMoving){
function initBackground () {
// Create gradient finishLinePosition = -1000;
const grd = ctx.createRadialGradient( width /2, height/2, 0.000, width/2, height/2, width/2); finishLineDrawn = false;
showWinnerText = true;
// Add colors winnerTextCounter = 0;
grd.addColorStop(0.101, 'rgba(255, 255, 255, 1.000)'); }
grd.addColorStop(1.000, 'rgba(116, 224, 224, 1.000)');
function drawRaceBackground(ctx, width, height, horseSize, cyclesRemaining, isMoving){
// Fill with gradient
ctx.fillStyle = grd; // Create gradient
ctx.fillRect(0, 0, width, height); const grd = ctx.createRadialGradient( width /2, height/2, 0.000, width/2, height/2, width/2);
// Draw Track // Add colors
ctx.fillStyle = '#CD853F'; grd.addColorStop(0.101, 'rgba(255, 255, 255, 1.000)');
ctx.fillRect(0, height - (2 * horseSize) , width, height); grd.addColorStop(1.000, 'rgba(116, 224, 224, 1.000)');
// Draw Distance left, or draw finishline // Fill with gradient
if (isMoving) { ctx.fillStyle = grd;
if (cyclesRemaining > 0) { ctx.fillRect(0, 0, width, height);
drawRemainingDistance(ctx, width, horseSize, cyclesRemaining);
} // Draw Track
else { ctx.fillStyle = '#CD853F';
if (!finishLineDrawn) { ctx.fillRect(0, height - (2 * horseSize) , width, height);
finishLineDrawn = true;
finishLinePosition = width; // Draw Distance left, or draw finishline
} if (isMoving && gameState !== "preRace") {
drawFinishLine(ctx, horseSize, height); if (cyclesRemaining > 0) {
finishLinePosition -= finishLineSpeed; drawRemainingDistance(ctx, width, horseSize, cyclesRemaining);
} }
} else {
if (!finishLineDrawn) {
// Draw grass finishLineDrawn = true;
ctx.fillStyle = '#32CD32'; finishLinePosition = width;
ctx.fillRect(0, height - (2.4 * horseSize) , width, horseSize/2); }
drawFinishLine(ctx, horseSize, height);
drawGuides(ctx, width, height, horseSize); finishLinePosition -= finishLineSpeed;
drawFence(ctx, width, ( height - (2 * horseSize)) , horseSize, isMoving); }
} }
else {
function drawGuides(ctx, width, height, horseSize){
}
ctx.fillStyle = "#000000";
ctx.beginPath(); // Draw grass
ctx.moveTo(0, height - (horseSize/2)); ctx.fillStyle = '#32CD32';
ctx.lineTo(width, height - (horseSize/2)); ctx.fillRect(0, height - (2.4 * horseSize) , width, horseSize/2);
ctx.stroke();
drawGuides(ctx, width, height, horseSize);
ctx.beginPath(); drawFence(ctx, width, ( height - (2 * horseSize)) , horseSize, isMoving);
ctx.moveTo(0, height - (horseSize)); }
ctx.lineTo(width, height - (horseSize));
ctx.stroke(); function drawGuides(ctx, width, height, horseSize){
ctx.beginPath(); ctx.fillStyle = "#000000";
ctx.moveTo(0, height - (horseSize * 1.5)); ctx.beginPath();
ctx.lineTo(width, height - (horseSize * 1.5)); ctx.moveTo(0, height - (horseSize/2));
ctx.stroke(); ctx.lineTo(width, height - (horseSize/2));
ctx.stroke();
}
ctx.beginPath();
function drawFence(ctx, width, fenceline, horseSize, isMoving) { ctx.moveTo(0, height - (horseSize));
ctx.lineTo(width, height - (horseSize));
ctx.fillStyle = '#322e1b'; ctx.stroke();
const postHeight = (horseSize /2); ctx.beginPath();
const postTop = fenceline - postHeight; ctx.moveTo(0, height - (horseSize * 1.5));
ctx.lineTo(width, height - (horseSize * 1.5));
for (let x = fenceOffset; x < width; x+=fencePostGap) { ctx.stroke();
const postStart = x;
ctx.fillStyle = '#322e1b'; }
ctx.fillRect(postStart, postTop , 7, postHeight);
} function drawFence(ctx, width, fenceline, horseSize, isMoving) {
ctx.fillStyle = "#000000"; ctx.fillStyle = '#322e1b';
ctx.beginPath();
ctx.moveTo(0, postTop); const postHeight = (horseSize /2);
ctx.lineTo(width, postTop); const postTop = fenceline - postHeight;
ctx.stroke();
for (let x = fenceOffset; x < width; x+=fencePostGap) {
if(isMoving){ const postStart = x;
fenceOffset -=5; ctx.fillStyle = '#322e1b';
} ctx.fillRect(postStart, postTop , 7, postHeight);
if (fenceOffset < 0) { fenceOffset = fencePostGap}; }
}
ctx.fillStyle = "#000000";
ctx.beginPath();
function drawRemainingDistance(ctx, width, horseSize, cyclesRemaining){ ctx.moveTo(0, postTop);
const remainingString = (cyclesRemaining /10).toFixed(1) + " Yards Remaining"; ctx.lineTo(width, postTop);
ctx.fillStyle = "#000000"; ctx.stroke();
ctx.font = "30px Arial";
ctx.fillText(remainingString, (width / 2) - 150, (horseSize / 2)); if(isMoving){
} fenceOffset -=5;
}
function drawCountdown(ctx, width, height, horseSize, seconds, horses){ if (fenceOffset < 0) { fenceOffset = fencePostGap};
}
console.log("draw countdown");
console.log(horses);
drawRaceBackground(ctx,width,height,horseSize, 0, false); function drawRemainingDistance(ctx, width, horseSize, cyclesRemaining){
const remainingString = (cyclesRemaining /10).toFixed(1) + " Yards Remaining";
ctx.fillStyle = "#000000"; ctx.fillStyle = "#000000";
ctx.font = "120px Arial"; ctx.font = "30px Arial";
ctx.fillText(remainingString, (width / 2) - 150, (horseSize / 2));
ctx.fillText(seconds, (width / 2) - 50, (horseSize )); }
for (let i = 0; i < horses.length; i++) { function drawCountdown(ctx, width, height, horseSize, seconds, horses){
drawHorseNamesinLane(ctx, horses[i], i, horseSize, height);
} console.log("draw countdown");
console.log(horses);
} drawRaceBackground(ctx,width,height,horseSize, 0, false);
function drawFinishLine(ctx, horseSize, height){ ctx.fillStyle = "#000000";
ctx.font = "120px Arial";
ctx.fillStyle = '#FFFFFF';
ctx.fillRect(finishLinePosition, height - (2 * horseSize) , 8 , height); ctx.fillText(seconds, (width / 2) - 50, (horseSize ));
} for (let i = 0; i < horses.length; i++) {
drawHorseNamesinLane(ctx, horses[i], i, horseSize, height);
function drawHorseNamesinLane(ctx,horse, lane, horseSize, height) { }
ctx.fillStyle = "#000000";
ctx.font = "40px Arial"; }
ctx.fillText(horse.name, horseSize, height - (lane * (horseSize / 2 )) -20); function drawFinishLine(ctx, horseSize, height){
ctx.fillText( "Created by: " + horse.owner, horseSize * 5, height - (lane * (horseSize / 2 )) -20);
ctx.fillStyle = '#FFFFFF';
} ctx.fillRect(finishLinePosition, height - (2 * horseSize) , 8 , height);
function drawResults(ctx, width, height, horseSize, finalPlaces){ }
drawRaceBackground(ctx,width,height,horseSize, 0, false);
// draw rectangle function drawHorseNamesinLane(ctx,horse, lane, horseSize, height) {
ctx.fillStyle = '#dddddd'; ctx.fillStyle = "#000000";
ctx.fillRect(horseSize*2, height - (.5 * horseSize) , (horseSize *4), - (horseSize * 3)); ctx.font = "40px Arial";
ctx.fillStyle = '#9999FF'; ctx.fillText(horse.name, horseSize, height - (lane * (horseSize / 2 )) -20);
ctx.fillRect(horseSize*2 + 3, height - (.5 * horseSize) -3 , (horseSize *4) -6, - (horseSize * 3) + 6 ); ctx.fillText( "Created by: " + horse.owner, horseSize * 5, height - (lane * (horseSize / 2 )) -20);
}
const first = "1ST - " + finalPlaces[0].name;
const second = "2ND - " + finalPlaces[1].name; function drawResults(ctx, width, height, horseSize, finalPlaces){
const third = "3RD - " + finalPlaces[2].name; drawRaceBackground(ctx,width,height,horseSize, 0, false);
const fourth = "4TH - " + finalPlaces[3].name; // draw rectangle
ctx.fillStyle = '#dddddd';
ctx.fillStyle = "#000000"; ctx.fillRect(horseSize*2, height - (.5 * horseSize) , (horseSize *4), - (horseSize * 3));
ctx.font = "40px Arial";
ctx.fillStyle = '#9999FF';
ctx.fillText("Final Results", horseSize* 3, height - (horseSize * 3)); ctx.fillRect(horseSize*2 + 3, height - (.5 * horseSize) -3 , (horseSize *4) -6, - (horseSize * 3) + 6 );
ctx.fillText(first, horseSize* 2.5, height - (horseSize * 2.5));
ctx.fillText(second, horseSize* 2.5, height - (horseSize * 2));
ctx.fillText(third, horseSize* 2.5, height -(horseSize * 1.5)); const first = "1ST - " + finalPlaces[0].name;
ctx.fillText(fourth,horseSize* 2.5, height - (horseSize)); const second = "2ND - " + finalPlaces[1].name;
const third = "3RD - " + finalPlaces[2].name;
} const fourth = "4TH - " + finalPlaces[3].name;
function drawWinnerCloseUp(ctx, width, height, horseSize, finalPlaces){
drawRaceBackground(ctx,width,height,horseSize, 0, false); ctx.fillStyle = "#000000";
// draw rectangle ctx.font = "40px Arial";
ctx.fillStyle = '#dddddd';
ctx.fillRect(horseSize*2, height - (.5 * horseSize) , (horseSize *4), - (horseSize * 3)); ctx.fillText("Final Results", horseSize* 3, height - (horseSize * 3));
ctx.fillText(first, horseSize* 2.5, height - (horseSize * 2.5));
ctx.fillStyle = '#9999FF'; ctx.fillText(second, horseSize* 2.5, height - (horseSize * 2));
ctx.fillRect(horseSize*2 + 3, height - (.5 * horseSize) -3 , (horseSize *4) -6, - (horseSize * 3) + 6 ); ctx.fillText(third, horseSize* 2.5, height -(horseSize * 1.5));
ctx.fillText(fourth,horseSize* 2.5, height - (horseSize));
ctx.drawImage(finalPlaces[0].image, horseSize * 2.5 , height - (.5 * horseSize) -5 , (horseSize *3) + 10 , - (horseSize * 3) + 10 );
}
//should hopefully flicker every 60 "frames" function drawWinnerCloseUp(ctx, width, height, horseSize, finalPlaces){
if (showWinnerText){ drawRaceBackground(ctx,width,height,horseSize, 0, false);
ctx.font = "40px Arial"; // draw rectangle
ctx.strokeStyle = '#000000'; ctx.fillStyle = '#dddddd';
ctx.lineWidth = 3; ctx.fillRect(horseSize*2, height - (.5 * horseSize) , (horseSize *4), - (horseSize * 3));
ctx.strokeText("Winner!!!", horseSize* 3, height - (horseSize * 3));
ctx.fillStyle = '#ffffff'; ctx.fillStyle = '#9999FF';
ctx.fillText("Winner!!!", horseSize* 3, height - (horseSize * 3)); ctx.fillRect(horseSize*2 + 3, height - (.5 * horseSize) -3 , (horseSize *4) -6, - (horseSize * 3) + 6 );
ctx.lineWidth =1; ctx.drawImage(finalPlaces[0].image, horseSize * 2.5 , height - (.5 * horseSize) -5 , (horseSize *3) + 10 , - (horseSize * 3) + 10 );
winnerTextCounter ++;
if (winnerTextCounter > 50){ ctx.font = "40px Arial";
showWinnerText = false; ctx.fillStyle = '#ffffff';
} ctx.strokeStyle = '#000000';
} ctx.lineWidth =1;
else { //should hopefully flicker every 60 "frames"
ctx.font = "40px Arial"; if (showWinnerText){
ctx.strokeStyle = '#000000';
ctx.lineWidth = 3; ctx.strokeText("Winner!!!", horseSize* 3, height - (horseSize * 3));
ctx.strokeText(finalPlaces[0].name, horseSize* 3, height - (horseSize * 3)+60); ctx.fillText("Winner!!!", horseSize* 3, height - (horseSize * 3));
ctx.fillStyle = '#ffffff';
ctx.fillText(finalPlaces[0].name, horseSize* 3, height - (horseSize * 3) + 60); winnerTextCounter ++;
if (winnerTextCounter > 50){
ctx.lineWidth =1; showWinnerText = false;
winnerTextCounter --; }
if (winnerTextCounter < 1){ }
showWinnerText = true; else {
} ctx.strokeText(finalPlaces[0].name, horseSize* 3, height - (horseSize * 3)+60);
} ctx.fillText(finalPlaces[0].name, horseSize* 3, height - (horseSize * 3) + 60);
winnerTextCounter --;
if (winnerTextCounter < 1){
showWinnerText = true;
}
}
// click to continue should always be present
ctx.strokeText("Click to start a new game!", horseSize* 3, height - horseSize );
ctx.fillText("Click to start a new game!", horseSize* 3, height - horseSize );
}
function drawStartScreen (ctx, bgctx, width, height, horseSize){
drawRaceBackground(ctx, width, height, horseSize, 999999, true);
} }

38
foreground_drawing.js Normal file
View File

@@ -0,0 +1,38 @@
function fg_drawShadows(ctx, horses,horseHeight, horseWidth) {
ctx.fillStyle = "rgba(0,0,0,0.25)";
ctx.beginPath();
ctx.ellipse(
horses[3].x + (horseWidth /2) , // center of horses position
HEIGHT - (horseHeight * 1.75),// center of lane
(horseWidth * .75) / 2,
(horseHeight * .25) / 2,
0, 0, Math.PI *2);
ctx.fill();
ctx.beginPath();
ctx.ellipse(
horses[2].x + (horseWidth /2) , // center of horses position
HEIGHT - (horseHeight * 1.25),// center of lane
(horseWidth * .75) / 2,
(horseHeight * .25) / 2,
0, 0, Math.PI *2);
ctx.fill();
ctx.beginPath();
ctx.ellipse(
horses[1].x + (horseWidth /2) , // center of horses position
HEIGHT - (horseHeight * .75),// center of lane
(horseWidth * .75) / 2,
(horseHeight * .25) / 2,
0, 0, Math.PI *2);
ctx.fill();
ctx.beginPath();
ctx.ellipse(
horses[0].x + (horseWidth /2) , // center of horses position
HEIGHT - (horseHeight * .25),// center of lane
(horseWidth * .75) / 2,
(horseHeight * .25) / 2,
0, 0, Math.PI *2);
ctx.fill();
}

807
game.js
View File

@@ -1,365 +1,442 @@
/** /**
* Created by tomdt on 6/23/2017. * Created by tomdt on 6/23/2017.
*/ */
let cyclesRemaining = 1000;
const GAME_CANVAS = document.getElementById("gamecanvas");
const horse_array = [ const BG_CANVAS = document.getElementById("bgcanvas");
{img: "./resources/horse_images/final/a_horse.png", name: "A Horse" , owner: "Ola"},
{img: "./resources/horse_images/final/BlackJack_10.png", name: "BlackJack", owner: "Jenn"}, const BG_CTX = BG_CANVAS.getContext("2d");
{img: "resources/horse_images/final/char_azNEIGHHble.png", name: "Char AzNIEGHHble" , owner: "Riley"}, const CTX = GAME_CANVAS.getContext("2d");
{img: "./resources/horse_images/final/CrotchRocket_93_raw.png", name: "CROTCH ROCKET", owner: "Ben"},
{img: "./resources/horse_images/final/DEMON_HORZE_666.png", name: "DEMON HORZE" , owner: "Ski"}, const COUNTDOWN_START_SECS = 35;
{img: "./resources/horse_images/final/dickzilla.png", name: "DickZilla" , owner: "Alex"},
{img: "./resources/horse_images/final/f-TheHaters.png", name: "Fuck the Haters" , owner: "Carlos"}, // Size parameters, they will be adjusted to fit the size of the screen
{img: "./resources/horse_images/final/GH.png", name: "GH" , owner: "Skoo"}, let WIDTH = GAME_CANVAS.width;
{img: "./resources/horse_images/final/Horse_cock.png", name: "Horse Cock" , owner: "Ben"}, let HEIGHT = GAME_CANVAS.height;
{img: "./resources/horse_images/final/horse_san_69.png", name: "Horse-San" , owner: "Riley"},
{img: "./resources/horse_images/final/killme112.png", name: "Kill Me" , owner: "Quinn"}, let horseWidth = WIDTH / 8;
{img: "./resources/horse_images/final/lil_sebastian.png", name: "Lil' Sebastian" , owner: "Horsey Heaven"}, let horseHeight = WIDTH / 8;
{img: "./resources/horse_images/final/stonewall_000.png", name: "Stonewall", owner: "Davie"},
// state tracking
]; let cyclesRemaining = 1000;
let gameState = "preRace"; // this should probably be an enum later
let horses = [];
const GAME_CANVAS = document.getElementById("gamecanvas"); let finalPlaces = [];
const BG_CANVAS = document.getElementById("bgcanvas"); let finishLineScan = 0;
let fanfarePlayedFlag = false;
const BG_CTX = BG_CANVAS.getContext("2d"); let placeCount = 1;
const CTX = GAME_CANVAS.getContext("2d"); let roundScored = false;
const COUNTDOWN_START_SECS = 10; let scoreboard = JSON.parse(window.localStorage.getItem("cd_scoreboard")) || {};
// Size parameters, they will be adjusted to fit the size of the screen //UI event handlers
let WIDTH = GAME_CANVAS.width; let clickHandlerLoaded = false;
let HEIGHT = GAME_CANVAS.height;
// sound effect triggers
let horseWidth = WIDTH / 8; const soundEffectTriggers = [Math.floor(Math.random() * (100)) + 700, // should be between 700 and 800
let horseHeight = WIDTH / 8; Math.floor(Math.random() * (100)) + 300, // should be between 300 and 400
// Math.floor(Math.random() * (100)) + 200, //between 200 - 300
// state tracking ];
let gameState = "preRace"; // this should probably be an enum later
const horses = [];
const finalPlaces = []; //Start game loop
let finishLineScan = 0; window.onload = ( ) => {
console.log("-- Scoreboard Check --");
let fanfarePlayedFlag = false; console.log(scoreboard);
initGame();
// sound effect triggers // The game loop should be a setInterval that way the screen size can be adjusted
setInterval(gameLoop, 20); // a touch <60 FPS
const soundEffectTriggers = [Math.floor(Math.random() * (100)) + 700, // should be between 700 and 800
Math.floor(Math.random() * (100)) + 300, // shuld be between 300 and 400 };
// Math.floor(Math.random() * (100)) + 200, //between 200 - 300
]; function initGame(){
cyclesRemaining = 1000;
gameState = "preRace"; // this should probably be an enum later
//Start game loop horses = [];
window.onload = ( ) => { finalPlaces = [];
// initBackground(); finishLineScan = 0;
fanfarePlayedFlag = false;
initHorses(); clickHandlerLoaded = false;
roundScored = false;
// The game loop should be a setInterval that way the screen size can be adjusted.
// I think its a bit easier to keep track of the state from one loop vs function callbacks initBackground();
setInterval(gameLoop, 20); // a touch <60 FPS initHorses();
}
};
function gameLoop(){
function gameLoop(){
switch(gameState){
switch(gameState){ case "preRace":
case "preRace": screenReset();
if (horses.length === 4){ drawStartScreen(CTX ,BG_CTX, WIDTH, HEIGHT, horseHeight);
gameState = 'countdownStart'; if (horses.length === 4){
console.log ("Horses loaded, transitioning to countdown"); if (!clickHandlerLoaded){
} let handler = function (event) {
break; gameState = 'countdownStart';
case "countdownStart": console.log ("Horses loaded, transitioning to countdown");
startCountdown(COUNTDOWN_START_SECS,BG_CTX); removeEventListener('click', handler, false);
break; clickHandlerLoaded = false;
case "running": } ;
screenReset(); window.addEventListener("click",handler,false);
runRace(CTX,BG_CTX); clickHandlerLoaded = true;
break; }
case "finishing": }
screenReset(); break;
runRace(CTX,BG_CTX); case "countdownStart":
break; startCountdown(COUNTDOWN_START_SECS,BG_CTX);
break;
case "finished": case "running":
//quick and dirty fanfare check screenReset();
if (!fanfarePlayedFlag){ runRace(CTX,BG_CTX);
playFanfare(); break;
fanfarePlayedFlag = true; case "finishing":
setTimeout(()=>{ screenReset();
gameState = "WinnerCloseUp"; runRace(CTX,BG_CTX);
}, 7 * 1000); break;
}
CTX.clearRect(0, 0, WIDTH, HEIGHT); case "finished":
drawResults(BG_CTX, WIDTH, HEIGHT, horseHeight, finalPlaces); //quick and dirty fanfare check
break; if (!fanfarePlayedFlag){
case "WinnerCloseUp": playFanfare();
drawWinnerCloseUp(BG_CTX, WIDTH, HEIGHT, horseHeight, finalPlaces); fanfarePlayedFlag = true;
break; setTimeout(()=>{
gameState = "WinnerCloseUp";
default: }, 7 * 1000);
break; }
} CTX.clearRect(0, 0, WIDTH, HEIGHT);
} drawResults(BG_CTX, WIDTH, HEIGHT, horseHeight, finalPlaces);
break;
function runRace(ctx,bg_ctx){ case "WinnerCloseUp":
drawWinnerCloseUp(BG_CTX, WIDTH, HEIGHT, horseHeight, finalPlaces);
cyclesRemaining --; if (!clickHandlerLoaded){
let handler = function () {
//handle race background console.log("Restarting game....")
drawRaceBackground(bg_ctx, WIDTH, HEIGHT, horseHeight, cyclesRemaining, true); initGame();
gameState = "preRace"
removeEventListener('click', handler, false);
//Figure out horse postitions clickHandlerLoaded = false;
const x = WIDTH / 2; };
const y = HEIGHT / 2; clickHandlerLoaded = true;
addEventListener('click', handler, false);
const lane_1_height = HEIGHT - (horseHeight * 1.25); }
//todo- change these sway varibles to be "trot" objects, or something, at put it in a horse object, so we can reuse these better break;
// horse 1 & 2 are hilarious, horse 3&4 are more normal paced
const horse_1_sway = Math.sin(cyclesRemaining) * 10; default:
break;
}
const lane_2_height = HEIGHT - (horseHeight * 1.75); }
const horse_2_sway = Math.cos(cyclesRemaining) * 10;
function runRace(ctx,bg_ctx){
const lane_3_height = HEIGHT - (horseHeight * 2.25); cyclesRemaining --;
const horse_3_sway = Math.sin(cyclesRemaining/2) * 10; //handle race background
drawRaceBackground(bg_ctx, WIDTH, HEIGHT, horseHeight, cyclesRemaining, true);
const lane_4_height = HEIGHT - (horseHeight * 2.75); //todo- change these sway varibles to be "trot" objects, or something, at put it in a horse object, so we can reuse these better
const horse_4_sway = Math.cos(cyclesRemaining/2) * 10; // horse 1 & 2 are hilarious, horse 3&4 are more normal paced
const lane_1_height = HEIGHT - (horseHeight * 1.25);
const horse_1_sway = Math.sin(cyclesRemaining) * 10;
updateHorsePositions();
const lane_2_height = HEIGHT - (horseHeight * 1.75);
checkForSoundEffects(cyclesRemaining); const horse_2_sway = Math.cos(cyclesRemaining) * 10;
//draw shadows under horses const lane_3_height = HEIGHT - (horseHeight * 2.25);
const horse_3_sway = Math.sin(cyclesRemaining/2) * 10;
// ctx.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle [, anticlockwise]);
ctx.fillStyle = "rgba(0,0,0,0.25)";
ctx.beginPath(); const lane_4_height = HEIGHT - (horseHeight * 2.75);
ctx.ellipse( const horse_4_sway = Math.cos(cyclesRemaining/2) * 10;
horses[3].x + (horseWidth /2) , // center of horses position
HEIGHT - (horseHeight * 1.75),// center of lane horses[0].y = (lane_1_height + horse_1_sway);
(horseWidth * .75) / 2, horses[1].y = (lane_2_height + horse_2_sway);
(horseHeight * .25) / 2, horses[2].y = (lane_3_height + horse_3_sway);
0, 0, Math.PI *2); horses[3].y = (lane_4_height + horse_4_sway);
ctx.fill();
ctx.beginPath(); updateHorsePositions();
ctx.ellipse(
horses[2].x + (horseWidth /2) , // center of horses position checkForSoundEffects(cyclesRemaining);
HEIGHT - (horseHeight * 1.25),// center of lane
(horseWidth * .75) / 2,
(horseHeight * .25) / 2, //draw shadows under horses
0, 0, Math.PI *2); fg_drawShadows(ctx, horses, horseHeight, horseWidth);
ctx.fill();
ctx.beginPath(); // draw horses - order is important!!!
ctx.ellipse( ctx.drawImage(horses[3].image, horses[3].x , horses[3].y , horseWidth, horseHeight);
horses[1].x + (horseWidth /2) , // center of horses position ctx.drawImage(horses[2].image, horses[2].x , horses[2].y , horseWidth, horseHeight);
HEIGHT - (horseHeight * .75),// center of lane ctx.drawImage(horses[1].image, horses[1].x , horses[1].y , horseWidth, horseHeight);
(horseWidth * .75) / 2, ctx.drawImage(horses[0].image, horses[0].x , horses[0].y , horseWidth, horseHeight);
(horseHeight * .25) / 2,
0, 0, Math.PI *2); if (cyclesRemaining <= 0 ){
ctx.fill(); if (gameState === 'running'){
ctx.beginPath(); console.log("checking for winners now");
ctx.ellipse( finishLineScan = WIDTH - horseWidth;
horses[0].x + (horseWidth /2) , // center of horses position gameState = "finishing";
HEIGHT - (horseHeight * .25),// center of lane }
(horseWidth * .75) / 2,
(horseHeight * .25) / 2, let foundHorseIndex = null;
0, 0, Math.PI *2);
ctx.fill(); for (let i = 0; i < horses.length; i++) {
//horse has finished
if (horses[i].x >= finishLineScan && horses[i].place === null){
if (!foundHorseIndex || horses[foundHorseIndex].x < horses[i].x) {
foundHorseIndex = i;
// draw horses }
ctx.drawImage(horses[3].image, horses[3].x , (lane_4_height + horse_4_sway) , horseWidth, horseHeight); }
ctx.drawImage(horses[2].image, horses[2].x , (lane_3_height + horse_3_sway) , horseWidth, horseHeight); }
ctx.drawImage(horses[1].image, horses[1].x , (lane_2_height + horse_2_sway) , horseWidth, horseHeight); if(foundHorseIndex != null){
ctx.drawImage(horses[0].image, horses[0].x , (lane_1_height + horse_1_sway) , horseWidth, horseHeight); finalPlaces.push(horses[foundHorseIndex]);
horses[foundHorseIndex].place = placeCount ++;
if (cyclesRemaining <= 0 ){ console.log("Horse Finished - " + foundHorseIndex);
if (gameState === 'running'){ }
console.log("checking for winners now"); // horses.splice(foundHorseIndex);
finishLineScan = WIDTH - horseWidth; if (finalPlaces.length === 4){
gameState = "finishing"; if (!roundScored){
} addWinnerToScoreboard(finalPlaces);
getAlltimeWinnerFromScoreboard();
let foundHorseIndex = null; roundScored = true;
}
console.log(finishLineScan); stopGallop();
// give it a bit of time before setting gameState to finished
for (let i = 0; i < horses.length; i++) { setTimeout(() => {
//horse has finished gameState = "finished";
if (horses[i].x >= finishLineScan && horses[i].place === null){ }, 2000)
if (!foundHorseIndex || horses[foundHorseIndex].x < horses[i].x) { }
foundHorseIndex = i; finishLineScan -= finishLineSpeed;
} }
} }
}
if(foundHorseIndex != null){
finalPlaces.push(horses[foundHorseIndex]); function initHorses(prevWinner) {
horses[foundHorseIndex].place = 1; console.log("initHorses");
console.log("Horse Finished - " + foundHorseIndex);
} if (prevWinner){
// horses.splice(foundHorseIndex);
if (finalPlaces.length === 4){ }
// gameState = "finished";
stopGallop(); const temp_horse_array = [];
// this will actually set the gamestate to finished for every frame, but it shouldnt matter since the gamestate never goes anywhere after finsihed //grab random horses
setTimeout(() => { while (temp_horse_array.length < 4) {
gameState = "finished"; let validPick = true;
}, 2000) // pick an index
} let pick = Math.floor(Math.random() * horse_array.length);
finishLineScan -= finishLineSpeed; // check if its taken
} for (let i =0; i < temp_horse_array.length; i ++){
} if (temp_horse_array[i].name === horse_array[pick].name){ validPick = false;}
}
//push to temp array
function initHorses() { if (validPick){
console.log("initHorses"); temp_horse_array.push(horse_array[pick]);
}
const temp_horse_array = []; console.log(temp_horse_array);
}
//grab random horses
while (temp_horse_array.length < 4) {
let validPick = true; // build horse game play objects
// pick an index for (let i =0; i < 4; i ++ ){
let pick = Math.floor(Math.random() * horse_array.length); console.log(i);
// check if its taken const horse_image = new Image();
for (let i =0; i < temp_horse_array.length; i ++){ horse_image.src = temp_horse_array[i].img;
if (temp_horse_array[i].name === horse_array[pick].name){ validPick = false;} const temphorse = temp_horse_array[i];
}
//push to temp array horse_image.onload = function() {
if (validPick){ const horse = {
temp_horse_array.push(horse_array[pick]); image: horse_image,
} name: temphorse.name,
console.log(temp_horse_array); owner: temphorse.owner,
} x:0,
y:0,
currentSpeed: null,
// build horse game play objects currentDestination:null,
for (let i =0; i < 4; i ++ ){ place: null,
console.log(i); changePositionCycles:[
const horse_image = new Image(); Math.floor(Math.random() * (100)) + 700, // should be between 700 and 800
horse_image.src = temp_horse_array[i].img; Math.floor(Math.random() * (100)) + 450, // shuld be between 450 and 550
const temphorse = temp_horse_array[i]; Math.floor(Math.random() * (100)) + 200, //between 200 - 300
]
horse_image.onload = function() {
const horse = { };
image: horse_image, horses.push(horse);
name: temphorse.name, }
owner: temphorse.owner, }
x:0,
y:0, }
currentSpeed: null,
currentDestination:null, function screenReset(){
place: null, HEIGHT = GAME_CANVAS.height = BG_CANVAS.height = window.innerHeight;
changePositionCycles:[ WIDTH = GAME_CANVAS.width = BG_CANVAS.width = window.innerWidth;
Math.floor(Math.random() * (100)) + 700, // should be between 700 and 800 horseWidth = horseHeight = WIDTH / 8;
Math.floor(Math.random() * (100)) + 450, // shuld be between 450 and 550 }
Math.floor(Math.random() * (100)) + 200, //between 200 - 300
]
function startCountdown(seconds, bg_ctx){
}; playCountdownAudio(seconds);
horses.push(horse); if (gameState === "countdownStart" ) {
} gameState = "countdownRunning";
} }
console.log ("Coundown: " + seconds);
}
if (seconds > 0) {
function screenReset(){ screenReset();
HEIGHT = GAME_CANVAS.height = BG_CANVAS.height = window.innerHeight; drawCountdown(bg_ctx, WIDTH, HEIGHT, horseHeight, seconds, horses);
WIDTH = GAME_CANVAS.width = BG_CANVAS.width = window.innerWidth; setTimeout (()=>{startCountdown( seconds - 1, bg_ctx)}, 1000);
horseWidth = horseHeight = WIDTH / 8; }
} else {
gameState = "running";
}
function startCountdown(seconds, bg_ctx){ }
playCountdownAudio(seconds);
if (gameState === "countdownStart" ) {
gameState = "countdownRunning"; function updateHorsePositions(){
}
console.log ("Coundown: " + seconds); for (let i = 0; i < horses.length; i++) {
const horse = horses[i];
if (seconds > 0) {
screenReset(); // update to current destination
drawCountdown(bg_ctx, WIDTH, HEIGHT, horseHeight, seconds, horses); if (horse.currentDestination === null){
setTimeout (()=>{startCountdown( seconds - 1, bg_ctx)}, 1000); horse.currentDestination = Math.floor(Math.random() * (WIDTH - horseWidth));
} }
else {
gameState = "running"; if (horse.currentSpeed === null){
} horse.currentSpeed= Math.floor(Math.random() * 5) + 3;
} }
if (horse.x > horse.currentDestination + 5 ){
function updateHorsePositions(){ horse.x -= horse.currentSpeed / 2;
}
for (let i = 0; i < horses.length; i++) { else if (horse.x < horse.currentDestination - 5){
const horse = horses[i]; horse.x += horse.currentSpeed;
}
// update to current destination
if (horse.currentDestination === null){ //add x sway
horse.currentDestination = Math.floor(Math.random() * (WIDTH - horseWidth)); horse.x += swayPatternFunctions[i].x(cyclesRemaining);
}
// blow away destination if horse has hit its reset point
if (horse.currentSpeed === null){ for (let i =0; i < horse.changePositionCycles.length; i ++){
horse.currentSpeed= Math.floor(Math.random() * 5) + 3; if (cyclesRemaining === horse.changePositionCycles[i]){
} horse.currentDestination = null;
horse.currentSpeed = null;
if (horse.x > horse.currentDestination + 5 ){ }
horse.x -= horse.currentSpeed / 2; }
}
else if (horse.x < horse.currentDestination - 5){ //last second reset for giggles!
horse.x += horse.currentSpeed; if(cyclesRemaining === 50 ){
} horse.currentDestination = null;
horse.currentSpeed = null;
//add x sway }
horse.x += swayPatternFunctions[i].x(cyclesRemaining); }
// blow away destination if horse has hit its reset point }
for (let i =0; i < horse.changePositionCycles.length; i ++){
if (cyclesRemaining === horse.changePositionCycles[i]){ function checkForSoundEffects(cycle){
horse.currentDestination = null; for (let i = 0; i < soundEffectTriggers.length; i++) {
horse.currentSpeed = null; if (cycle === soundEffectTriggers[i]){
} playRandomNeigh();
} }
}
//last second reset for giggles! }
if(cyclesRemaining === 50 ){
horse.currentDestination = null; swayPatternFunctions = [
horse.currentSpeed = null; {x:(cycle)=>{ return Math.cos(cycle/3) * 10;}, y:(cycle)=>{return Math.sin(cycle) * 10} },
} {x:(cycle)=>{ return Math.sin(cycle/3) * 10;}, y:(cycle)=>{ return Math.cos(cycle) * 10;}},
} {x:(cycle)=>{ return Math.cos(cycle/4) * 10;}, y:(cycle)=>{ return Math.sin(cycle/2) * 10}},
{x:(cycle)=>{ return Math.sin(cycle/4) * 10;}, y:(cycle)=>{ return Math.cos(cycle/2) * 10}}
} ];
function checkForSoundEffects(cycle){
for (let i = 0; i < soundEffectTriggers.length; i++) { function addWinnerToScoreboard(finalPlaceArray){
if (cycle === soundEffectTriggers[i]){
playRandomNeigh(); let makeFirst = true;
} let makeSecond = true;
} let makeThird = true;
} let makeFourth = true;
swayPatternFunctions = [ // check for existing horses in scoreboard
{x:(cycle)=>{ return Math.cos(cycle/3) * 10;}, y:(cycle)=>{return Math.sin(cycle) * 10} }, for( const horseScoreListing in scoreboard){
{x:(cycle)=>{ return Math.sin(cycle/3) * 10;}, y:(cycle)=>{ return Math.cos(cycle) * 10;}}, if (horseScoreListing === finalPlaceArray[0].name){
{x:(cycle)=>{ return Math.cos(cycle/4) * 10;}, y:(cycle)=>{ return Math.sin(cycle/2) * 10}}, makeFirst = false;
{x:(cycle)=>{ return Math.sin(cycle/4) * 10;}, y:(cycle)=>{ return Math.cos(cycle/2) * 10}} scoreboard[horseScoreListing].totalRaces ++;
]; scoreboard[horseScoreListing].firstPlaces ++;
} else if (horseScoreListing === finalPlaceArray[1].name){
makeSecond = false;
scoreboard[horseScoreListing].totalRaces ++;
scoreboard[horseScoreListing].secondPlaces ++;
} else if (horseScoreListing === finalPlaceArray[2].name){
makeThird = false;
scoreboard[horseScoreListing].totalRaces ++;
scoreboard[horseScoreListing].thirdPlaces ++;
} else if (horseScoreListing === finalPlaceArray[3].name){
makeFourth = false;
scoreboard[horseScoreListing].totalRaces ++;
scoreboard[horseScoreListing].forthPlaces ++;
}
}
//
if (makeFirst){
scoreboard[finalPlaceArray[0].name] = {totalRaces: 1, firstPlaces: 1, secondPlaces: 0, thirdPlaces: 0, forthPlaces:0}
}
if (makeSecond){
scoreboard[finalPlaceArray[1].name] = {totalRaces: 1, firstPlaces: 0, secondPlaces: 1, thirdPlaces: 0, forthPlaces:0}
}
if (makeThird){
scoreboard[finalPlaceArray[2].name] = {totalRaces: 1, firstPlaces: 0, secondPlaces: 0, thirdPlaces: 1, forthPlaces:0}
}
if (makeFourth){
scoreboard[finalPlaceArray[3].name] = {totalRaces: 1, firstPlaces: 0, secondPlaces: 0, thirdPlaces: 0, forthPlaces:1}
}
// Save Scoreboard to local variable again.
window.localStorage.setItem("cd_scoreboard", JSON.stringify(scoreboard));
}
function getAlltimeWinnerFromScoreboard(){
console.log(scoreboard);
let mostwins = 0;
let winningHorse = "";
for( const horseScoreListing in scoreboard){
if (scoreboard[horseScoreListing].firstPlaces > mostwins) {
mostwins = scoreboard[horseScoreListing].firstPlaces;
winningHorse = horseScoreListing;
}
}
if (mostwins > 0 ){
console.log("The winningest horse of all time is " +winningHorse+ " with a total of " +mostwins+ " wins");
}
}
function deleteScoreboard() {
scoreboard = {};
window.localStorage.setItem("cd_scoreboard", JSON.stringify(scoreboard));
}
let deletecheck = false;
window.addEventListener("keypress", (e)=>{
if (e.key === 'd'){
if (deletecheck === false){
deletecheck = true;
console.log("Press again to delete scoreboard, press any other key to cancel");
}
else {
console.log("deleting scoreboard");
deleteScoreboard()
}
}else {
deletecheck = false
}
if (e.key === "s"){
console.log(scoreboard);
}
if(e.key ===" "){
document.body.click();
}
},false);

View File

@@ -1,21 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title> <title>
Crivitz Derby Crivitz Derby
</title> </title>
<link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="main.css">
</head> </head>
<body> <body>
<canvas id="fgcanvas"></canvas> <canvas id="fgcanvas"></canvas>
<canvas id="gamecanvas"></canvas> <canvas id="gamecanvas"></canvas>
<canvas id="bgcanvas"></canvas> <canvas id="bgcanvas"></canvas>
<script src="resources/libs/howler.js"> </script> <script src="resources/libs/howler.js"> </script>
<script src="audio.js"></script> <script src="resources/horse_array.js"></script>
<script src="background.js" ></script> <script src="audio.js"></script>
<script src="game.js" ></script> <script src="background.js" ></script>
</body> <script src="foreground_drawing.js" ></script>
<script src="game.js" ></script>
</body>
</html> </html>

View File

@@ -1,30 +1,30 @@
html, body{ html, body{
height: 100%; height: 100%;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
} }
#gamecanvas{ #gamecanvas{
z-index: 200; z-index: 200;
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
/*display: block;*/ /*display: block;*/
/*margin: auto;*/ /*margin: auto;*/
/*border: 5px solid black;*/ /*border: 5px solid black;*/
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
#bgcanvas{ #bgcanvas{
z-index: 10; z-index: 10;
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
/*display: block;*/ /*display: block;*/
/*margin: auto;*/ /*margin: auto;*/
/*border: 5px solid black;*/ /*border: 5px solid black;*/
height: 100%; height: 100%;
width: 100%; width: 100%;
} }

28
resources/horse_array.js Normal file
View File

@@ -0,0 +1,28 @@
const horse_array = [
{img: "./resources/horse_images/final/a_horse.png", name: "A Horse" , owner: "Ola"},
{img: "./resources/horse_images/final/BlackJack_10.png", name: "BlackJack", owner: "Jenn"},
{img: "resources/horse_images/final/char_azNEIGHHble.png", name: "Char AzNIEGHHble" , owner: "Riley"},
{img: "./resources/horse_images/final/CrotchRocket_93_raw.png", name: "CROTCH ROCKET", owner: "Ben"},
{img: "./resources/horse_images/final/DEMON_HORZE_666.png", name: "DEMON HORZE" , owner: "Ski"},
{img: "./resources/horse_images/final/dickzilla.png", name: "DickZilla" , owner: "Alex"},
{img: "./resources/horse_images/final/f-TheHaters.png", name: "Fuck the Haters" , owner: "Carlos"},
{img: "./resources/horse_images/final/GH.png", name: "GH" , owner: "Skoo"},
{img: "./resources/horse_images/final/Horse_cock.png", name: "Horse Cock" , owner: "Ben"},
{img: "./resources/horse_images/final/horse_san_69.png", name: "Horse-San" , owner: "Riley"},
{img: "./resources/horse_images/final/killme112.png", name: "Kill Me" , owner: "Quinn"},
{img: "./resources/horse_images/final/lil_sebastian.png", name: "Lil' Sebastian" , owner: "Horsey Heaven"},
{img: "./resources/horse_images/final/stonewall_000.png", name: "Stonewall", owner: "Davie"},
{img: "./resources/horse_images/final/nobody_cares.png", name: "Nobody Cares", owner: "Brendan"},
{img: "./resources/horse_images/final/Raibow_sparkle.png", name: "Rainbow Sparkle", owner: "Cyndi"},
{img: "./resources/horse_images/final/arthur_horsegan.png", name: "Arthur Horsegan", owner: "Zucchini"},
{img: "./resources/horse_images/final/arthur_morgan.png", name: "Arthur Morgan", owner: "Carlos"},
{img: "./resources/horse_images/final/bob.png", name: "Bob", owner: "Ski"},
{img: "./resources/horse_images/final/elmers.png", name: "Elmers", owner: "Quinn"},
{img: "./resources/horse_images/final/hugsy.png", name: "Hugsy", owner: "Jenn"},
{img: "./resources/horse_images/final/ikea.png", name: "Ikea", owner: "Quinn"},
{img: "./resources/horse_images/final/platty.png", name: "Platty", owner: "Ski"},
{img: "./resources/horse_images/final/saweetie.png", name: "Saweetie", owner: "Ola"},
{img: "./resources/horse_images/final/Shitty_ponyta.png", name: "Shitty Ponyta", owner: "Zucchini"},
{img: "./resources/horse_images/final/Hand_Banana.png", name: "Hand Banana", owner: "Carl"},
];

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long