mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
db4a346d21
Introduced state_manager.js almost all State gets/sets are now run through the manager (alias $SM). For now it was a simple, mostly straightforward replacement of calls. This means that there are redundancies and a lot of now unneeded code for things the SM will handle. However, since I had trouble with making those changes as well as introducing the manager all at once my first attempt, I am taking the wiser approach and making "one change" at a time like I should have instead of being too sure of myself. At this point, it seems to work, but there may be bugs I didn't catch. There was also no attempt made to update old saves to work with this. In theory, it shouldn't be too hard. (included is a list of all state changes) TODO: Save Update. Refactor: a lot, many many redundancies now. Refactor: "location centric" to "global centric". Relocate all calls to different update functions to event listeners where possible. ====================================================== The changes to State are as follows: .room (exists) > features.location.room .room > game.room .room.builder > game.room.builder .room.temperature > game.room.temperature .room.fire > game.room.fire .room.buttons > game.room.buttons .outside (exists) > features.location.outside .outside > game.outside .outside.population > game.outside.population .outside.buildings > game.outside.buildings .outside.workers > game.outside.workers .outside.seenForest > game.outside.seenForest .world (exists) > features.location.world .world > game.world .world.map > game.world.map .world.mask > game.world.mask .starved > character.starved .dehydrated > character.dehydrated .ship (exists) > featuers.location.spaceShip .ship > game.spaceShip .ship.hull > game.spaceShip.hull .ship.thrusters > game.spaceShip.thrusters .ship.seenWarning > game.spaceShip.seenWarning .ship.seenShip > game.spaceShip.seenShip .punches > character.punches .perks > character.perks .thieves > game.thieves .stolen > game.stolen .cityCleared > game.cityCleared .stores > stores .income > income
82 lines
3.1 KiB
HTML
82 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html itemscope itemtype="http://schema.org/CreativeWork">
|
|
<head>
|
|
<!--
|
|
A Dark Room (v1.2)
|
|
==================
|
|
|
|
A minimalist text adventure by Michael Townsend.
|
|
Inspired by Candy Box (http://candies.aniwey.net/)
|
|
Please don't steal me.
|
|
-->
|
|
<title>A Dark Room</title>
|
|
<meta itemprop="description" name="description" property="og:description" content="A minimalist text adventure">
|
|
<meta itemprop="image" property="og:image" content="img/adr.png" />
|
|
<meta itemprop="name" property="og:title" content="A Dark Room" />
|
|
<link rel="shortcut icon" href="favicon.ico" />
|
|
<link rel="image_src" href="img/adr.png" />
|
|
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
|
|
use local file for testing to avoid loads -->
|
|
<script src="lib/jquery.min.js"></script>
|
|
<script src="lib/jquery.color-2.1.2.min.js"></script>
|
|
<script src="lib/jquery.event.move.js"></script>
|
|
<script src="lib/jquery.event.swipe.js"></script>
|
|
<script src="script/Button.js"></script>
|
|
<script src="script/engine.js"></script>
|
|
<script src="script/state_manager.js"></script>
|
|
<script src="script/header.js"></script>
|
|
<script src="script/notifications.js"></script>
|
|
<script src="script/events.js"></script>
|
|
<script src="script/room.js"></script>
|
|
<script src="script/outside.js"></script>
|
|
<script src="script/world.js"></script>
|
|
<script src="script/path.js"></script>
|
|
<script src="script/ship.js"></script>
|
|
<script src="script/space.js"></script>
|
|
<!-- Event modules -->
|
|
<script src="script/events/global.js"></script>
|
|
<script src="script/events/room.js"></script>
|
|
<script src="script/events/outside.js"></script>
|
|
<script src="script/events/encounters.js"></script>
|
|
<script src="script/events/setpieces.js"></script>
|
|
|
|
<script type='text/javascript'>
|
|
var oldIE = false;
|
|
</script>
|
|
<!-- [if lt IE 9]>
|
|
<script type="text/javascript">oldIE = true;</script>
|
|
<![endif]-->
|
|
|
|
<link rel="stylesheet" type="text/css" href="css/main.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/room.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/outside.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/path.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/world.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/ship.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/space.css" />
|
|
|
|
<!-- Google Analytics -->
|
|
<script>
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', 'UA-41314886-1', 'doublespeakgames.com');
|
|
ga('send', 'pageview');
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="wrapper">
|
|
<div id="saveNotify">saved.</div>
|
|
<div id="content">
|
|
<div id="outerSlider">
|
|
<div id="main">
|
|
<div id="header"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |