Commit Graph

57 Commits

Author SHA1 Message Date
jorsi 44a7552de4 fix room music playing when in another scene 2020-06-03 18:14:19 -04:00
jorsi 3b43a2754a refactor audio engine: simplified gain channels, improve fading between audio, rename functions 2020-06-03 17:44:27 -04:00
jorsi 113596fca6 rough outline for room audio 2020-05-31 19:19:36 -04:00
jorsi 1d4f48b464 fix music not starting on arrival when fire is dead 2020-05-31 14:02:23 -04:00
jorsi d3f1d9c779 prototype fire sounds 2020-05-31 13:53:43 -04:00
jorsi 18e8af9809 refactor audio-related code to use AudioLibrary module 2020-05-30 23:33:10 -04:00
jorsi a340584136 create AudioLibrary module to consolidate audio 2020-05-30 23:03:46 -04:00
jorsi 1d84e5f85c connect majority actions to sound effects;add more placeholder loops and effects 2020-05-30 19:48:44 -04:00
jorsi 71786c3671 add majority of sound definitions 2020-05-30 17:20:01 -04:00
jorsi 221a97035c add more room sounds definitions 2020-05-29 19:04:49 -04:00
jorsi c35912b3ff add more sound definitions 2020-05-29 18:47:10 -04:00
jorsi bd519404c2 add Room craft* sound effect definitions 2020-05-29 18:33:47 -04:00
jorsi de9d2e6a17 add more sound effect definitions 2020-05-29 18:21:40 -04:00
jorsi 39fbd169ad add rest of sound definitions for room 2020-05-29 18:14:35 -04:00
jorsi 12c6559802 add basic outline of audio for room 2020-05-29 17:53:18 -04:00
jorsi 978f53d40b rough implementation for changing background music 2020-05-29 13:59:58 -04:00
Lucas Lois fb9e39bbaf Merge branch 'master' into jshint-compliance 2017-01-25 11:44:18 -03:00
Jennifer 3ae7ee16cc tooltip on top near bottom of store and trading post 2016-12-10 21:09:18 -08:00
Lucas Lois c1ce1a89d9 Made room.js jshint compliant 2016-10-02 17:52:39 -03:00
Michael Townsend 8a80f7c164 Fixing bugs 2016-09-23 11:32:34 -04:00
Andrea Rendine 4bd00fa328 No check on null stores
Unlike other stuff, stores in the side box never disappear during the game when they reach 0, once they've been "seen" (i.e., once State stores[store] has been set). But on reload they appear only if the quantity is positive.
For the sake of consistency, now null stores are visible on load (see what you're missing, bro).
2016-02-14 21:24:43 +01:00
Continuities a0b343246c Code style 2015-08-02 11:40:27 -04:00
Sebring 1e37f45530 Display time delay on total row in tooltip 2015-07-29 20:08:09 +02:00
Sebring fea54cd97f Add total to tooltip 2015-07-29 16:57:26 +02:00
Andrea Rendine 03fae08ff2 Compass relocation
This commit carries some changes.
* the compass is now a "special" item, not "good". It allows a different placing
* Store block is now divided into 2 parts. All the script is adapted to make room for it, including empty block check and insert animation for the new #store children divs
** Above: stackable storable items (resources), whose tooltip shows updated income/consumption rates
** Below: special storable items. As of now, it only contains the compass. Special block has a special style, with some distance from resources block if that one exists.
* Compass row has an empty tooltip which is filled in by World
2015-06-28 14:27:37 -04:00
Andrea Rendine 92f7cf683e Unified legend
Legends on boxes and lists are currently added via CSS and as stylesheets cannot be localised, translated strings rely upon an additional inline CSS.
This commit inserts localised legends as "data-legend" attributes on proper elements, and then this attribute is shown by stylesheet rule content: attr(data-legend). No need of localisation script and more compact CSS rules.
2015-06-26 22:10:02 -04:00
Andrea Rendine ebf5e6934e Correct DOM positions for village, store, perks box
I noticed a minor glitch with the Village box position in the DOM. As it is appended to the Outside panel, it can end up after the Wood gather button or after the Traps check. It depends on whether the latter exists or not.
I changed it a little. Now it is "prepended" (thanks jQuery!), so it's always before any other content in the panel.
It would mind e.g. for CSS consistency, as you could decide to use a style for sibling buttons and it wouldn't work unless the box is placed before or after (not between) them.

For consistency with Outside box placement issue, stores are prepended to the Room panel, as first content in the DOM tree.

For consistency with Outside box placement issue, perks are prepended to the Path panel, as first content in the DOM tree.
2015-05-13 12:01:32 -04:00
Andrea Rendine 4efebe4f66 Var
Working in a hurry is bad.
2015-04-30 17:26:56 +02:00
Andrea Rendine dca3faa2f9 Fixed variable name
"k" still refers to the English string, while "lk" carries the translated value.
2015-04-30 16:57:18 +02:00
Andrea Rendine 8042414be7 Stores alphabetical sorting
The bulk of this small change was to sort stores by alphabetical order according to translated names, instead of english strings.
This meant removing the ID splitting as well as hyphen/space replacing, as the ID is not considered for the test.
Also changed:
1. line 800: as the original english string is no longer necessary in the iteration, k takes the value of translated string. k is then used for alphabetical comparison (as before) with the right value.
2. line 816: removed the test on curPrev variable. Items already listed have been placed in alphabetical order, so there is no need to check whether each item actually follows value of control variable.
2015-04-29 23:43:43 +02:00
Travis Weston 6ee6470972 Merging updates 2015-02-11 18:55:27 -05:00
Blake Grotewold c87541b8b9 Merge pull request #222 from anubisthejackle/issue80 2015-02-09 19:37:10 -05:00
Travis Weston 6e044292ae Add in doubleTime capabilities
Add hyper / classic to menu
2015-02-09 19:31:24 -05:00
Robert Gravina 67b3c7fb7e Low-risk fixes suggested by JSHint. 2015-02-09 19:20:29 -05:00
Blake Grotewold 7e1ac332ac Change temp and fire to take from value not text for i18n
This change fixes the issue of the game using the text from the saved
fire and temperature states. Clean up of the game store should be done
before next release to just save fire and temperature values only in
`game.fire` and `game.temperature` respectively.
2014-10-03 09:57:17 -04:00
Blake Grotewold 0f9ceda729 Merge pull request #102 from anubisthejackle/whitespace-fixes
Covert whitespace to tabs as per coding standard
2014-07-17 19:25:45 -04:00
Blake Grotewold 185e4c3c86 Fix the room is fire.
Typo of the game.temerature.text instead of game.fire.text
2014-07-16 18:57:34 -04:00
Blake Grotewold eb5b008225 Add fire and temperature to State.game
Adding fire and temperature to game state will allow persistence of the
fire and temp on reloads.
2014-07-15 23:52:33 -04:00
Travis Weston 249b8742ff Fixed whitespace conformity in room.js 2014-07-13 11:21:34 -04:00
Vanadar c7ad5384f4 suite des trads 2014-02-07 18:26:03 +01:00
Vanadar 71ee298e50 suite des traductions 2014-02-06 18:36:14 +01:00
Vanadar 7ac28eeb1a suites des trads 2014-02-05 17:06:30 +01:00
Michael 994f01c78c Some refactoring and some bug fixes. 2013-11-01 23:00:51 -04:00
Michael dde477aade Some general code cleanup. 2013-10-10 20:53:53 -04:00
Andrew Salamon 5f5ff3701e Fixed a problem where the stores view wasn't updating. 2013-10-09 15:32:05 -07:00
LucidCrux 6561e88f9f lots of bugfixes
- bugfix Engine.startThieves call changed to $SM call
- bugfix $SM.remove not deleting state
- bugfix workaround for empty string when creating states
     For some reason splitting "state.sub.sub2["sub3"]" will result in
     empty strings whereas "state.sub.sub2[\'sub3\']" didn't. Maybe a
     javascript regex quirk?

     Had to add a loop to remove '' from the split string array.
- modified collectIncome so that only one update event fires for the 
  whole function, no event if no income was added.
- modified updateBuildButtons so that buttons would show up if the
  building had already been built.
     changed check to be wood != undefined

     Also changed room to display store values of 0 instead of removing 
     the row. It was distracting to have the values shift up and down 
     when tightly managing a resource. If you haven't seen a resource 
     yet, it still doesn't show up.
2013-07-27 17:21:30 -06:00
LucidCrux 99800f1abd refactor Outside to use $SM + Room bugfix, \' to "
Refactoring of Outside.js to take better advantage of $SM and simplify
the code.

Includes a small bug fix to Room update handler

Also changed instances of escaped single quote (\') to double (") for
readability and simplicity.

====state changes====
//these were changed for the opposite reason the Room states were. These
seem like states that other locations and events may very well want to
interact with and possibly alter themselves
game.outside.buildings >> game.buildings 
game.outside.population >> game.population
game.outside.workders >> game.workers


====functions removed====
Outside.numBuilding // just a $SM.get, no shortcut really needed since
Outside.numBuilding is a pretty long name
Outside.getPopulation // same here
Outside.addBuilding // just an add
Outside.addBuildings // just addM, but wasn't even actually used


====functions refactored====
Outside.killVillagers //moved updates to handler
Outside.updateWorkersView //added local to reduce gets
Outside.increasePopulation //updates moved to handler
Outside.increaseWorker // updates moved to handler
Outside.decreaseWorkder // updates moved to handler
2013-07-26 19:21:12 -06:00
LucidCrux f4d2e8deae change to property Room.fire, Room.temperature, Room.buttons
Changed these States into properties of room. They are only ever
accessed by Room and there is no real reason to save them. By not
saving the state each time, it also makes the the player start out in
'a dark room' on every load. Rather fitting I think, and gives the fire
a little bit more purpose if you have to rewarm the builder.
2013-07-25 21:05:43 -06:00
LucidCrux 2e3f8abd3f add $SM.setget, refactor Room to better use $SM
game.room.builder >> game.builder.level

setget is mainly for use in local copies of states, useful for keeping
code cleaner and less redundant while maintaining set/get of states by
the $SM

====functions refactored====
Room.unlockForext //remove update calls
Room.buy //remove update calls
Room.build //remove update calls
Room.cooFire //added locals to reduce gets
Room.adjustTemp //added locals to reduce gets
Room.updateBuilderState //added local to reduce gets
Room.craftUnlocked //Room unlock is always going to be true, don't need
to check parents to avoid errors anymore
Room.buyUnlocked //Room unlock is always going to be true, don't need to
check parents to avoid errors anymore
2013-07-25 20:31:30 -06:00
LucidCrux 2018ca3ae8 create and configure callback handlers for state updates
add $.Dispatch to handle object events
add subscribe calls to files
update SM fireUpdate to use new Dispatch

There are some NaN issues right now, no time to bug hunt right now, it
does kind of function though
2013-07-24 18:33:06 -06:00