Added the TweenManager

This commit is contained in:
Richard Davey 2013-08-29 00:09:12 +01:00
parent d323404676
commit b8d3a61c97
16 changed files with 2070 additions and 15 deletions

1
.idea/.name Normal file
View file

@ -0,0 +1 @@
phaser

5
.idea/encodings.xml Normal file
View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

22
.idea/misc.xml Normal file
View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="sslv3">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<option name="IGNORE_EXTERNALS" value="false" />
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
</project>

9
.idea/modules.xml Normal file
View file

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

9
.idea/phaser.iml Normal file
View file

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

View file

@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

7
.idea/vcs.xml Normal file
View file

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

377
.idea/workspace.xml Normal file
View file

@ -0,0 +1,377 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="328b4373-7ebd-4676-80bd-f923b549551e" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/dictionaries/rich.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Phaser/Game.ts" afterPath="$PROJECT_DIR$/Phaser/Game.ts" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Tests/phaser-debug.js" afterPath="$PROJECT_DIR$/Tests/phaser-debug.js" />
</list>
<ignored path="phaser.iws" />
<ignored path=".idea/workspace.xml" />
<file path="/Dummy.txt" changelist="328b4373-7ebd-4676-80bd-f923b549551e" time="1377531136009" ignored="false" />
<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="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="phaser" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="Game.ts" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Phaser/Game.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="264" column="34" selection-start="8048" selection-end="8048" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="OrientationScreen.ts" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Phaser/system/screens/OrientationScreen.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="11" selection-start="1321" selection-end="1321" vertical-scroll-proportion="0.42040184">
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitLogSettings">
<option name="myDateState">
<MyDateState />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/Phaser/Game.ts" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="22" />
<option name="width" value="1440" />
<option name="height" value="806" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="2" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents ProjectPane="true" />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Tests" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Tests" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="physics" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="system" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Phaser" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="system" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="screens" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="options.splitter.main.proportions" value="0.3" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="options.lastSelected" value="preferences.externalResources" />
<property name="FullScreen" value="false" />
<property name="options.searchVisible" value="true" />
<property name="options.splitter.details.proportions" value="0.2" />
</component>
<component name="PublishConfig" serverName="Phaser" serverId="225c7bc1-6c9a-4190-bc47-0fcc143efc13">
<servers>
<server id="225c7bc1-6c9a-4190-bc47-0fcc143efc13">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</server>
</servers>
</component>
<component name="RunManager">
<configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
<option name="VMOptions" />
<option name="arguments" />
<option name="filePath" />
<option name="scope" value="ALL" />
<option name="testName" />
<method />
</configuration>
<list size="0" />
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="328b4373-7ebd-4676-80bd-f923b549551e" name="Default" comment="" />
<created>1377531134782</created>
<updated>1377531134782</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="22" width="1440" height="806" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24629499" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="CHECK_NEW_TODO" value="true" />
<option name="myTodoPanelSettings">
<value>
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</value>
</option>
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="SHORT_DIFF_HORIZONTALLY" value="true" />
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
<option name="SHOW_DIRTY_RECURSIVELY" value="false" />
<option name="LIMIT_HISTORY" value="true" />
<option name="MAXIMUM_HISTORY_ROWS" value="1000" />
<option name="UPDATE_FILTER_SCOPE_NAME" />
<option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
<option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
<option name="LAST_COMMIT_MESSAGE" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="UPDATE_FILTER_BY_SCOPE" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Tests/physics/circle 1.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="82" column="25" selection-start="2223" selection-end="2223" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Phaser/math/Vec2.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="20" column="8" selection-start="391" selection-end="391" vertical-scroll-proportion="-5.431818">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Phaser/physics/PhysicsManager.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Phaser/physics/Body.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="41" selection-start="511" selection-end="511" vertical-scroll-proportion="0.41731066">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Phaser/Game.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="264" column="34" selection-start="8048" selection-end="8048" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Phaser/system/screens/OrientationScreen.ts">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="11" selection-start="1321" selection-end="1321" vertical-scroll-proportion="0.42040184">
<folding />
</state>
</provider>
</entry>
</component>
</project>

View file

@ -0,0 +1,9 @@
{
"folders":
[
{
"follow_symlinks": true,
"path": "/Users/rich/Documents/phaser"
}
]
}

View file

@ -0,0 +1,967 @@
{
"auto_complete":
{
"selected_items":
[
[
"inter",
"intersectsRaw"
],
[
"cont",
"containsRect"
],
[
"prot",
"prototype"
],
[
"atl",
"atlasURL"
],
[
"addT",
"addTextureAtlas"
],
[
"TEX",
"TEXTURE_ATLAS_JSON_HASH (variable)"
],
[
"ad",
"appendChild (function)"
],
[
"fun",
"function"
],
[
"prop",
"properties"
],
[
"the",
"the_terms"
],
[
"load",
"loadPuzzleRatings"
],
[
"tr",
"true"
],
[
"font-",
"font-family"
],
[
"sca",
"scaling"
],
[
"Pos",
"Position"
],
[
"Po",
"Position"
],
[
"to",
"toString"
],
[
"phas",
"phaserSpace"
],
[
"cen",
"centroid2"
],
[
"set",
"setPosition"
],
[
"space",
"Space"
],
[
"iter",
"iteration"
],
[
"mar",
"margin-bottom"
],
[
"font",
"font-size"
],
[
"puzzle",
"puzzle_id"
],
[
"cre",
"createSprite"
],
[
"displ",
"displaySummary"
],
[
"strr",
"strrpos"
],
[
"file",
"filename"
],
[
"save",
"save_result"
],
[
"proces",
"processFile"
],
[
"single",
"single_file"
],
[
"all",
"all_files"
],
[
"sing",
"single_file"
],
[
"bac",
"background-color"
],
[
"text",
"text-decoration"
],
[
"va",
"vars"
],
[
"con",
"consts"
],
[
"c",
"consts"
],
[
"class",
"classname"
],
[
"clas",
"classname"
],
[
"output",
"output_file"
],
[
"str_re",
"str_replace"
],
[
"input",
"input_dir"
],
[
"back",
"background-size"
],
[
"wait",
"waitingHelpscreen"
],
[
"juke",
"jukebox"
],
[
"jukeb",
"jukeboxPP"
],
[
"start",
"startTheEngines"
],
[
"star",
"startPause"
],
[
"Beak",
"BeakerGameStartGameHook"
],
[
"Bea",
"BeakerGameStartGameHook"
],
[
"crea",
"createHD"
],
[
"whee",
"wheelUp"
],
[
"whe",
"wheelSpeed"
],
[
"cr",
"currentDelivery"
],
[
"let",
"letter1"
],
[
"g",
"getLetterData"
],
[
"sc",
"scanIt"
],
[
"pro",
"progressFill"
],
[
"up",
"update"
],
[
"deli",
"delivery1"
],
[
"ju",
"justPressed"
],
[
"de",
"delivery1"
],
[
"del",
"delivery"
],
[
"is",
"isShowingDelivery"
],
[
"he",
"height"
],
[
"fc",
"function"
],
[
"roun",
"roundTimer"
],
[
"drage",
"dragEndTime"
],
[
"drags",
"dragStartTime"
],
[
"drag",
"dragStartY"
],
[
"_id",
"_idCount"
],
[
"_oncom",
"_onCompleteCallbackFired"
],
[
"round",
"roundComplete"
],
[
"scr",
"scrollUp"
],
[
"shad",
"shadowFloatY"
],
[
"pau",
"pauseScreen"
],
[
"ne",
"nextRound"
],
[
"sha",
"shadow"
],
[
"flo",
"floatOff"
],
[
"st",
"startY"
],
[
"pip",
"piplin1"
],
[
"tw",
"tween"
],
[
"rou",
"round"
],
[
"time",
"timeToShine"
],
[
"shado",
"shadowY"
],
[
"shi",
"shine"
],
[
"shin",
"shineY"
],
[
"sh",
"shineY"
],
[
"pp",
"piplin1"
],
[
"setup",
"setupRound"
],
[
"leaf",
"leafX"
],
[
"rust",
"rustleOut"
],
[
"rus",
"rustleTimer"
],
[
"lea",
"leaves"
],
[
"hit",
"hitContext"
],
[
"ol",
"oldY"
],
[
"old",
"oldX"
],
[
"rot",
"rotation"
],
[
"ro",
"rotation"
],
[
"l",
"leaves"
],
[
"pi",
"piplin2"
],
[
"game",
"gameButton2"
],
[
"pl",
"playGame"
],
[
"mouse",
"mouseEnabled"
],
[
"first",
"first_time_online"
],
[
"use",
"useWebAudio"
],
[
"web",
"webAudioSupported"
],
[
"pop",
"poppedTotal"
],
[
"fn",
"function"
],
[
"bubb",
"bubbleSize"
],
[
"bub",
"bubbleMaxY"
],
[
"sele",
"selectGame"
],
[
"gameb",
"gameButton1"
],
[
"selec",
"selectScreen"
],
[
"pla",
"playButton"
],
[
"titl",
"titleScreen"
],
[
"tit",
"titleScreen"
],
[
"dr",
"drawGridLines"
],
[
"init",
"initGame"
],
[
"die",
"diveSpeed"
],
[
"wave",
"waveY"
],
[
"dive",
"diveCanvas"
],
[
"wa",
"waveY"
],
[
"di",
"diveContext"
],
[
"divec",
"diveContext"
],
[
"wavet",
"waveTween1"
]
]
},
"buffers":
[
],
"build_system": "",
"command_palette":
{
"height": 380.0,
"selected_items":
[
[
"pack",
"Package Control: Install Package"
]
],
"width": 416.0
},
"console":
{
"height": 146.0,
"history":
[
]
},
"distraction_free":
{
"menu_visible": true,
"show_minimap": false,
"show_open_files": false,
"show_tabs": false,
"side_bar_visible": false,
"status_bar_visible": false
},
"file_history":
[
"/D/wamp/www/phaser/TS Source/tweens/TweenManager.js",
"/D/wamp/www/phaser/src/geom/Rectangle.js",
"/D/wamp/www/phaser/TS Source/utils/RectangleUtils.js",
"/D/wamp/www/phaser/TS Source/geom/Rectangle.js",
"/D/wamp/www/phaser/src/system/Device.js",
"/D/wamp/www/phaser/src/math/Math.js",
"/D/wamp/www/phaser/examples/point.html",
"/D/wamp/www/phaser/src/geom/Point.js",
"/D/wamp/www/phaser/src/geom/Circle.js",
"/D/wamp/www/phaser/TS Source/utils/PointUtils.js",
"/D/wamp/www/phaser/TS Source/geom/Point.js",
"/D/wamp/www/phaser/TS Source/time/TimeManager.js",
"/D/wamp/www/phaser/TS Source/time/TimeManager.ts",
"/D/wamp/www/phaser/TS Source/math/GameMath.js",
"/D/wamp/www/phaser/examples/math sincos.html",
"/D/wamp/www/phaser/examples/circle.html",
"/D/wamp/www/phaser/TS Source/utils/CircleUtils.js",
"/D/wamp/www/phaser/TS Source/geom/Circle.js",
"/D/wamp/www/phaser/src/time/Time.js",
"/D/wamp/www/phaser/src/net/Net.js",
"/D/wamp/www/phaser/examples/net.html",
"/D/wamp/www/phaser/TS Source/net/Net.js",
"/D/wamp/www/phaser/src/animation/Parser.js",
"/D/wamp/www/phaser/src/loader/Cache.js",
"/D/wamp/www/phaser/src/loader/Loader.js",
"/D/wamp/www/phaser/examples/loader audio.html",
"/D/wamp/www/phaser/examples/loader spritesheet.html",
"/D/wamp/www/phaser/examples/loader atlas xml.html",
"/D/wamp/www/phaser/examples/loader atlas json.html",
"/D/wamp/www/phaser/examples/assets/sprites/shoebot.xml",
"/D/wamp/www/phaser/src/animation/Frame.js",
"/D/wamp/www/phaser/TS Source/loader/AnimationLoader.js",
"/D/wamp/www/phaser/TS Source/loader/AnimationLoader.ts",
"/D/wamp/www/phaser/src/animation/Animation.js",
"/D/wamp/www/phaser/src/loader/AnimationLoader.js",
"/D/wamp/www/phaser/src/animation/FrameData.js",
"/D/wamp/www/phaser/TS Source/animation/FrameData.ts",
"/D/wamp/www/phaser/TS Source/animation/FrameData.js",
"/D/wamp/www/phaser/TS Source/animation/Frame.ts",
"/D/wamp/www/phaser/TS Source/animation/Frame.js",
"/D/wamp/www/phaser/examples/loader 2.html",
"/D/wamp/www/bbc-wolfblood/game.js",
"/D/wamp/www/phaser/examples/loader.html",
"/D/wamp/www/phaser/TS Source/loader/Loader.js",
"/D/wamp/www/phaser/TS Source/Game.js",
"/D/wamp/www/phaser/TS Source/loader/Cache.js",
"/D/wamp/www/phaser/TS Source/loader/Cache.ts",
"/D/wamp/www/phaser/src/Phaser.js",
"/D/wamp/www/phaser/TS Source/loader/Loader.ts",
"/D/wamp/www/phaser/src/math/RandomDataGenerator.js",
"/D/wamp/www/phaser/src/core/SignalBinding.js",
"/D/wamp/www/phaser/src/core/Signal.js",
"/D/wamp/www/phaser/examples/signals.html",
"/D/wamp/www/phaser/examples/rnd.html",
"/D/wamp/www/phaser/TS Source/core/Signal.js",
"/D/wamp/www/js-signals/src/Signal.js",
"/D/wamp/www/js-signals/src/wrapper.js",
"/D/wamp/www/pixi.js/examples/example 1 - Basics/index.html",
"/D/wamp/www/awasenghi/lib/Core.js",
"/D/wamp/www/phaser/TS Source/math/RandomDataGenerator.js",
"/D/wamp/www/Nonsense/Nonsense.js",
"/D/wamp/www/numtums/pop/bake.php",
"/D/wamp/www/phaser/src/pixi/Pixi.js",
"/D/wamp/www/phaser/TS Source/Phaser.ts",
"/D/wamp/www/bbc-wolfblood/tsc.txt",
"/D/wamp/www/bbc-wolfblood/load.php",
"/D/wamp/www/phaser/build/phaser-debug.js",
"/D/wamp/www/bbc-wolfblood/embed.js",
"/D/wamp/www/phaser/README.md",
"/D/wamp/www/bbc-wolfblood/mobile.php",
"/D/wamp/www/bbc-wolfblood/load-desktop.php",
"/D/wamp/www/bbc-wolfblood/Wolfblood/Wolfblood.csproj",
"/D/wamp/www/phaser/Phaser/defToXML.php",
"/D/wamp/www/bbc-wolfblood/Phaser/Phaser.csproj",
"/D/wamp/www/bbc-wolfblood/mobile-wolfblood-min.js",
"/D/wamp/www/elmo/README.md",
"/C/Users/rich/AppData/Local/Temp/dtemp-6fdf6c055229125-20.dop/mobile-wolfblood-min.js",
"/C/Users/rich/AppData/Local/Temp/dtemp-6fafca055212843-20.dop/wolfblood-min.js",
"/C/Users/rich/Desktop/embed.js",
"/D/wamp/www/bbc-wolfblood/embed (1).js",
"/C/Users/rich/Desktop/Q3.qif",
"/C/Users/rich/Downloads/Sheet 52.qif",
"/C/Users/rich/Downloads/Sheet 49-51.qif",
"/C/Users/rich/Downloads/Sheet 48.qif",
"/C/Users/rich/Downloads/Sheets 45-47.qif",
"/C/Users/rich/Downloads/Sheet 44.qif",
"/C/Users/rich/Downloads/Sheet 40 (May).qif",
"/D/wamp/www/bbc-wolfblood/Wolfblood/sha1.js",
"/D/webroot/phaser.io/index.html",
"/D/wamp/www/phaser/Phaser/Stage.js",
"/D/wamp/www/phaser/Tests/physics/temp2.ts",
"/D/wamp/www/phaser/Tests/physics/aabb vs aabb 1.js",
"/D/wamp/www/phaser/Tests/physics/aabb 1.js",
"/D/wamp/www/Proton/example/helloworld/emitter/emitter.html",
"/D/wamp/www/Proton/src/emitter/Emitter.js",
"/D/wamp/www/Proton/src/initialize/InitializeUtil.js",
"/D/wamp/www/Proton/src/initialize/Position.js",
"/D/wamp/www/Proton/src/render/BaseRender.js",
"/D/wamp/www/Proton/src/render/Renderer.js",
"/D/wamp/www/Proton/src/render/CanvasRender.js",
"/D/wamp/www/Proton/src/zone/Zone.js",
"/D/wamp/www/Proton/src/zone/PointZone.js",
"/D/wamp/www/Proton/src/plus/ease.js",
"/D/wamp/www/Proton/src/behaviour/RandomDrift.js",
"/D/wamp/www/Proton/src/math/ColorSpan.js",
"/D/wamp/www/Proton/src/math/NumericalIntegration.js",
"/D/wamp/www/Proton/src/math/MathUtils.js",
"/D/wamp/www/Proton/src/behaviour/Behaviour.js",
"/D/wamp/www/Proton/src/initialize/Velocity.js",
"/D/wamp/www/Proton/src/math/Polar2D.js",
"/D/wamp/www/Proton/src/behaviour/Scale.js",
"/D/wamp/www/Proton/src/behaviour/Repulsion.js",
"/D/wamp/www/Proton/src/initialize/Rate.js",
"/D/wamp/www/Proton/src/core/Proton.js",
"/D/wamp/www/Proton/src/core/Particle.js",
"/D/wamp/www/Proton/src/core/ParticlePool.js",
"/D/wamp/www/Proton/src/initialize/Life.js",
"/D/wamp/www/Proton/src/initialize/Radius.js",
"/D/wamp/www/Proton/src/utils/Util.js",
"/D/wamp/www/Proton/src/math/Span.js",
"/D/wamp/www/Proton/src/initialize/Initialize.js",
"/D/wamp/www/Proton/src/initialize/Mass.js",
"/D/wamp/www/bbc-jigsaw/sarahandduck/frame.html",
"/D/wamp/www/phaser/Tests/phaser.css",
"/D/wamp/www/phaser/Docs/tags.txt",
"/D/wamp/www/phaser/Docs/docs_server.bat",
"/D/wamp/www/phaser/Docs/docs_build.bat",
"/D/wamp/www/phaser/Phaser/Phaser.csproj"
],
"find":
{
"height": 34.0
},
"find_in_files":
{
"height": 90.0,
"where_history":
[
"D:\\wamp\\www\\phaser\\src\\pixi",
"D:\\wamp\\www\\phaser\\Tests\\tilemap",
"D:\\wamp\\www\\phaser\\Tests\\sprites",
"D:\\wamp\\www\\phaser\\Tests\\particles",
"D:\\wamp\\www\\phaser\\Tests\\mini games",
"D:\\wamp\\www\\phaser\\Tests\\misc",
"D:\\wamp\\www\\phaser\\Tests\\input",
"D:\\wamp\\www\\phaser\\Tests\\groups",
"D:\\wamp\\www\\phaser\\Tests\\collision",
"D:\\wamp\\www\\phaser\\Tests\\cameras",
"<open files>",
"D:\\wamp\\www\\bbc\\firsttimeonline\\src",
"D:\\wamp\\www\\bbc\\hideandseek\\src",
"D:\\wamp\\www\\clients\\bitecp\\lib\\game",
"D:\\wamp\\www\\numtums\\swipetum\\src"
]
},
"find_state":
{
"case_sensitive": false,
"find_history":
[
"TweenManager.prototype.",
"Phaser.Rectangle.",
"a.",
"RectangleUtils",
"defineProperty(Rectangle.prototype",
"});",
"x",
"Rectangle.prototype.",
"this.android",
"dest",
"this",
"a",
"*",
"Point.prototype.",
"GameMath.prototype.",
"};",
"GameMath.prototype.",
"};",
"GameMath.prototype.",
"};",
"GameMath.prototype.",
"source",
"(Circle.prototype",
"defineProperty",
"getter",
"public ",
"Net.prototype.",
"this.TEXTURE",
"Phaser",
"FrameData.prototype.",
"number;",
"public ",
"pop",
"_queueSize",
"nextFile",
"Cache.prototype.",
"public ",
"{bool}",
" if (this._fileList[key]) {\n return true;\n } else {\n return false;\n }\n",
"_queueSize",
"Phaser.Signal",
";",
"private ",
"public ",
"validateListener",
" : function",
"SignalBinding",
" : function",
" : ",
"validateListener",
"Nonsense.prototype.",
" = ",
";",
" = null",
"this.",
"Maze",
"Include=\"",
"=",
"Fixed",
"wolfblood",
"index.php",
"unrated",
"UNRATED",
"setAll",
"Game.Sound",
"unlock",
"pause",
".value",
".pause",
"noteOn",
"refreshBuffer",
".src",
"line",
"onAlpha",
"bunny",
"bunnies",
"bunny",
"write",
"step",
"shapes",
"].",
"hapes",
"verts",
"transform",
"position",
"Manager",
"position",
"solveVelocityConstraints",
"false",
"position",
"p",
"ju",
"\n ",
"position",
"staticBody",
"stepCount",
"stats =",
"frameRateHz",
"collision",
"ready",
"runFrame",
" Manager.write('findContactSolver. Length: ' + this.contactSolvers.length);\nfindContact",
"postSolve",
"gravity",
"runFrame",
"onClickedPlayer",
"step",
"Manager",
"solveVelocity",
"velocitySolver",
"initSolve",
"step",
"contactSolverArr",
"add",
"findContact",
"contactSolvers",
"add",
"norma",
"saveSceneToServer",
"console",
"saveSceneToServer",
"drawBox",
"drawBodyShape",
"scale",
"damping",
"gravity",
"timeDelta",
" for (var i = 0; i <= 10; i++) {\n var body = new Body(Body.DYNAMIC, new vec2(-6 + i * 1.2, 8));\n var shape = new ShapeCircle(0, 0, 0.4);\n shape.e = i / 10;\n shape.u = 1.0;\n shape.density = 1;\n body.addShape(shape);\n body.resetMassData();\n space.addBody(body);\n }\n"
],
"highlight": true,
"in_selection": false,
"preserve_case": false,
"regex": false,
"replace_history":
[
"queueSize",
"{boolean}",
"queueSize",
"Phaser.SignalBinding",
"launcher.html",
"/Phaser/",
"",
"SignalBinding",
"Signal",
"/// <reference path=\"../Signal.ts\" />\n/// <reference path=\"../SignalBinding.ts\" />",
"Quadratic",
"//Playtomic",
"hasSwiped",
"firsttimeonline/html5",
"this.popped",
"if (game.useWebAudio === false)",
"sd/",
"assets/hd/",
"runningWellDoneSequence",
"html5/media/",
"duckButton",
"bestfootforward",
"duckButton",
"",
"cardBack",
"hideURLBar",
"isGameComplete",
"sengi",
"Sengi",
"style.display"
],
"reverse": false,
"show_context": true,
"use_buffer2": true,
"whole_word": false,
"wrap": true
},
"groups":
[
{
"sheets":
[
]
}
],
"incremental_find":
{
"height": 0.0
},
"input":
{
"height": 34.0
},
"layout":
{
"cells":
[
[
0,
0,
1,
1
]
],
"cols":
[
0.0,
1.0
],
"rows":
[
0.0,
1.0
]
},
"menu_visible": true,
"project": "Phaser OSX.sublime-project",
"replace":
{
"height": 62.0
},
"save_all_on_build": true,
"select_file":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"select_project":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"select_symbol":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"settings":
{
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 284.0,
"status_bar_visible": true,
"template_settings":
{
}
}

View file

@ -560,7 +560,10 @@
},
"console":
{
"height": 146.0
"height": 146.0,
"history":
[
]
},
"distraction_free":
{
@ -914,6 +917,7 @@
{
"buffer": 0,
"file": "src/Game.js",
"semi_transient": false,
"settings":
{
"buffer_size": 5482,
@ -1044,6 +1048,7 @@
{
"buffer": 1,
"file": "todo/Tween.js",
"semi_transient": false,
"settings":
{
"buffer_size": 12434,
@ -1174,6 +1179,7 @@
{
"buffer": 2,
"file": "src/tween/TweenManager.js",
"semi_transient": false,
"settings":
{
"buffer_size": 3317,
@ -1335,6 +1341,7 @@
]
},
"menu_visible": true,
"project": "Phaser.sublime-project",
"replace":
{
"height": 62.0
@ -1356,10 +1363,24 @@
],
"width": 0.0
},
"select_symbol":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"settings":
{
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 284.0,
"status_bar_visible": true
"status_bar_visible": true,
"template_settings":
{
}
}

View file

@ -11,6 +11,9 @@
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
@ -26,17 +29,16 @@
var game = new Phaser.Game(this, '', 800, 600);
var a = new Phaser.Point(100, 100);
var b = new Phaser.Point(200, 100);
var test = { x: 0 };
console.log('Point A', a.toString());
console.log('Point B', b.toString());
var tween = game.tweens.create(test);
a.add(b.x, b.y);
tween.onComplete.add(onComplete, this);
tween.to({x: 100}, 1000, Phaser.Easing.Linear.None, true);
console.log('Point A + B', a.toString());
console.log('Distance between A and B', Phaser.Point.distance(a, b));
function onComplete() {
console.log('tween finished, new data: ', test);
}
</script>

View file

@ -184,7 +184,7 @@ Phaser.Game.prototype = {
this.cache = new Phaser.Cache(this);
this.load = new Phaser.Loader(this);
this.time = new Phaser.Time(this);
// this.tweens = new Phaser.TweenManager(this);
this.tweens = new Phaser.TweenManager(this);
// this.input = new Phaser.InputManager(this);
// this.sound = new Phaser.SoundManager(this);
this.rnd = new Phaser.RandomDataGenerator([(Date.now() * Math.random()).toString()]);

278
src/tween/Easing.js Normal file
View file

@ -0,0 +1,278 @@
Phaser.Easing = {
Linear: {
None: function ( k ) {
return k;
}
},
Quadratic: {
In: function ( k ) {
return k * k;
},
Out: function ( k ) {
return k * ( 2 - k );
},
InOut: function ( k ) {
if ( ( k *= 2 ) < 1 ) return 0.5 * k * k;
return - 0.5 * ( --k * ( k - 2 ) - 1 );
}
},
Cubic: {
In: function ( k ) {
return k * k * k;
},
Out: function ( k ) {
return --k * k * k + 1;
},
InOut: function ( k ) {
if ( ( k *= 2 ) < 1 ) return 0.5 * k * k * k;
return 0.5 * ( ( k -= 2 ) * k * k + 2 );
}
},
Quartic: {
In: function ( k ) {
return k * k * k * k;
},
Out: function ( k ) {
return 1 - ( --k * k * k * k );
},
InOut: function ( k ) {
if ( ( k *= 2 ) < 1) return 0.5 * k * k * k * k;
return - 0.5 * ( ( k -= 2 ) * k * k * k - 2 );
}
},
Quintic: {
In: function ( k ) {
return k * k * k * k * k;
},
Out: function ( k ) {
return --k * k * k * k * k + 1;
},
InOut: function ( k ) {
if ( ( k *= 2 ) < 1 ) return 0.5 * k * k * k * k * k;
return 0.5 * ( ( k -= 2 ) * k * k * k * k + 2 );
}
},
Sinusoidal: {
In: function ( k ) {
return 1 - Math.cos( k * Math.PI / 2 );
},
Out: function ( k ) {
return Math.sin( k * Math.PI / 2 );
},
InOut: function ( k ) {
return 0.5 * ( 1 - Math.cos( Math.PI * k ) );
}
},
Exponential: {
In: function ( k ) {
return k === 0 ? 0 : Math.pow( 1024, k - 1 );
},
Out: function ( k ) {
return k === 1 ? 1 : 1 - Math.pow( 2, - 10 * k );
},
InOut: function ( k ) {
if ( k === 0 ) return 0;
if ( k === 1 ) return 1;
if ( ( k *= 2 ) < 1 ) return 0.5 * Math.pow( 1024, k - 1 );
return 0.5 * ( - Math.pow( 2, - 10 * ( k - 1 ) ) + 2 );
}
},
Circular: {
In: function ( k ) {
return 1 - Math.sqrt( 1 - k * k );
},
Out: function ( k ) {
return Math.sqrt( 1 - ( --k * k ) );
},
InOut: function ( k ) {
if ( ( k *= 2 ) < 1) return - 0.5 * ( Math.sqrt( 1 - k * k) - 1);
return 0.5 * ( Math.sqrt( 1 - ( k -= 2) * k) + 1);
}
},
Elastic: {
In: function ( k ) {
var s, a = 0.1, p = 0.4;
if ( k === 0 ) return 0;
if ( k === 1 ) return 1;
if ( !a || a < 1 ) { a = 1; s = p / 4; }
else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );
return - ( a * Math.pow( 2, 10 * ( k -= 1 ) ) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) );
},
Out: function ( k ) {
var s, a = 0.1, p = 0.4;
if ( k === 0 ) return 0;
if ( k === 1 ) return 1;
if ( !a || a < 1 ) { a = 1; s = p / 4; }
else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );
return ( a * Math.pow( 2, - 10 * k) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) + 1 );
},
InOut: function ( k ) {
var s, a = 0.1, p = 0.4;
if ( k === 0 ) return 0;
if ( k === 1 ) return 1;
if ( !a || a < 1 ) { a = 1; s = p / 4; }
else s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );
if ( ( k *= 2 ) < 1 ) return - 0.5 * ( a * Math.pow( 2, 10 * ( k -= 1 ) ) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) );
return a * Math.pow( 2, -10 * ( k -= 1 ) ) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) * 0.5 + 1;
}
},
Back: {
In: function ( k ) {
var s = 1.70158;
return k * k * ( ( s + 1 ) * k - s );
},
Out: function ( k ) {
var s = 1.70158;
return --k * k * ( ( s + 1 ) * k + s ) + 1;
},
InOut: function ( k ) {
var s = 1.70158 * 1.525;
if ( ( k *= 2 ) < 1 ) return 0.5 * ( k * k * ( ( s + 1 ) * k - s ) );
return 0.5 * ( ( k -= 2 ) * k * ( ( s + 1 ) * k + s ) + 2 );
}
},
Bounce: {
In: function ( k ) {
return 1 - TWEEN.Easing.Bounce.Out( 1 - k );
},
Out: function ( k ) {
if ( k < ( 1 / 2.75 ) ) {
return 7.5625 * k * k;
} else if ( k < ( 2 / 2.75 ) ) {
return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;
} else if ( k < ( 2.5 / 2.75 ) ) {
return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;
} else {
return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;
}
},
InOut: function ( k ) {
if ( k < 0.5 ) return TWEEN.Easing.Bounce.In( k * 2 ) * 0.5;
return TWEEN.Easing.Bounce.Out( k * 2 - 1 ) * 0.5 + 0.5;
}
}
};

345
src/tween/Tween.js Normal file
View file

@ -0,0 +1,345 @@
/**
* Tween constructor
* Create a new <code>Tween</code>.
*
* @param object {object} Target object will be affected by this tween.
* @param game {Phaser.Game} Current game instance.
*/
Phaser.Tween = function (object, game) {
/**
* Reference to the target object.
* @type {object}
*/
this._object = object;
this.game = game;
this._manager = this.game.tweens;
this._valuesStart = {};
this._valuesEnd = {};
this._valuesStartRepeat = {};
this._duration = 1000;
this._repeat = 0;
this._yoyo = false;
this._reversed = false;
this._delayTime = 0;
this._startTime = null;
this._easingFunction = Phaser.Easing.Linear.None;
this._interpolationFunction = Phaser.Math.linearInterpolation;
this._chainedTweens = [];
this._onStartCallback = null;
this._onStartCallbackFired = false;
this._onUpdateCallback = null;
this._onCompleteCallback = null;
this._pausedTime = 0;
// Set all starting values present on the target object
for ( var field in object ) {
this._valuesStart[ field ] = parseFloat(object[field], 10);
}
// this.onStart = new Phaser.Signal();
// this.onUpdate = new Phaser.Signal();
this.onComplete = new Phaser.Signal();
this.isRunning = false;
};
Phaser.Tween.prototype = {
/**
* Configure the Tween
* @param properties {object} Propertis you want to tween.
* @param [duration] {number} duration of this tween.
* @param [ease] {any} Easing function.
* @param [autoStart] {bool} Whether this tween will start automatically or not.
* @param [delay] {number} delay before this tween will start, defaults to 0 (no delay)
* @param [loop] {bool} Should the tween automatically restart once complete? (ignores any chained tweens)
* @return {Tween} Itself.
*/
to: function ( properties, duration, ease, autoStart, delay, repeat, yoyo ) {
if (typeof duration === "undefined") { duration = 1000; }
if (typeof ease === "undefined") { ease = null; }
if (typeof autoStart === "undefined") { autoStart = false; }
if (typeof delay === "undefined") { delay = 0; }
if (typeof repeat === "undefined") { repeat = 0; }
if (typeof yoyo === "undefined") { yoyo = false; }
this._duration = duration;
this._valuesEnd = properties;
if (ease !== null) {
this._easingFunction = ease;
}
if (delay > 0) {
this._delayTime = delay;
}
this._yoyo = yoyo;
if (autoStart) {
return this.start();
} else {
return this;
}
},
start: function ( time ) {
//TWEEN.add( this );
if (this.game === null || this._object === null) {
return;
}
this.isRunning = true;
this._onStartCallbackFired = false;
// this._startTime = time !== undefined ? time : ( typeof window !== 'undefined' && window.performance !== undefined && window.performance.now !== undefined ? window.performance.now() : Date.now() );
// this._startTime += _delayTime;
this._startTime = this.game.time.now + this._delayTime;
for ( var property in this._valuesEnd ) {
// check if an Array was provided as property value
if ( this._valuesEnd[ property ] instanceof Array ) {
if ( this._valuesEnd[ property ].length === 0 ) {
continue;
}
// create a local copy of the Array with the start value at the front
this._valuesEnd[ property ] = [ this._object[ property ] ].concat( this._valuesEnd[ property ] );
}
this._valuesStart[ property ] = this._object[ property ];
if ( ( this._valuesStart[ property ] instanceof Array ) === false ) {
this._valuesStart[ property ] *= 1.0; // Ensures we're using numbers, not strings
}
this._valuesStartRepeat[ property ] = this._valuesStart[ property ] || 0;
}
return this;
},
stop: function () {
//TWEEN.remove( this );
if (this._manager !== null) {
this._manager.remove(this);
}
this.isRunning = false;
return this;
},
delay: function ( amount ) {
this._delayTime = amount;
return this;
},
repeat: function ( times ) {
this._repeat = times;
return this;
},
yoyo: function( yoyo ) {
this._yoyo = yoyo;
return this;
},
easing: function ( easing ) {
this._easingFunction = easing;
return this;
},
interpolation: function ( interpolation ) {
this._interpolationFunction = interpolation;
return this;
},
chain: function () {
this._chainedTweens = arguments;
return this;
},
onStart: function ( callback ) {
this._onStartCallback = callback;
return this;
},
onUpdate: function ( callback ) {
this._onUpdateCallback = callback;
return this;
},
onComplete: function ( callback ) {
this._onCompleteCallback = callback;
return this;
},
pause: function () {
this._paused = true;
},
resume: function () {
this._paused = false;
this._startTime += this.game.time.pauseDuration;
},
update: function ( time ) {
if (this._paused || time < this._startTime) {
return true;
}
var property;
if ( time < this._startTime ) {
return true;
}
if ( this._onStartCallbackFired === false ) {
if ( this._onStartCallback !== null ) {
this._onStartCallback.call( this._object );
}
this._onStartCallbackFired = true;
}
var elapsed = ( time - this._startTime ) / this._duration;
elapsed = elapsed > 1 ? 1 : elapsed;
var value = this._easingFunction( elapsed );
for ( property in this._valuesEnd ) {
var start = this._valuesStart[ property ] || 0;
var end = this._valuesEnd[ property ];
if ( end instanceof Array ) {
this._object[ property ] = this._interpolationFunction( end, value );
} else {
// Parses relative end values with start as base (e.g.: +10, -3)
if ( typeof(end) === "string" ) {
end = start + parseFloat(end, 10);
}
// protect against non numeric properties.
if ( typeof(end) === "number" ) {
this._object[ property ] = start + ( end - start ) * value;
}
}
}
if ( this._onUpdateCallback !== null ) {
this._onUpdateCallback.call( this._object, value );
}
if ( elapsed == 1 ) {
if ( this._repeat > 0 ) {
if ( isFinite( this._repeat ) ) {
this._repeat--;
}
// reassign starting values, restart by making startTime = now
for ( property in this._valuesStartRepeat ) {
if ( typeof( this._valuesEnd[ property ] ) === "string" ) {
this._valuesStartRepeat[ property ] = this._valuesStartRepeat[ property ] + parseFloat(this._valuesEnd[ property ], 10);
}
if (this._yoyo) {
var tmp = this._valuesStartRepeat[ property ];
this._valuesStartRepeat[ property ] = this._valuesEnd[ property ];
this._valuesEnd[ property ] = tmp;
this._reversed = !this._reversed;
}
this._valuesStart[ property ] = this._valuesStartRepeat[ property ];
}
this._startTime = time + this._delayTime;
return true;
} else {
if ( this._onCompleteCallback !== null ) {
this.onComplete.dispatch(this._object);
this._onCompleteCallback.call( this._object );
}
for ( var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i ++ ) {
this._chainedTweens[ i ].start( time );
}
return false;
}
}
return true;
}
};

View file

@ -96,17 +96,15 @@ Phaser.TweenManager.prototype = {
*
* @return {bool} Return false if there's no tween to update, otherwise return true.
*/
update: function ( time ) {
update: function () {
if ( _tweens.length === 0 ) return false;
var i = 0, numTweens = _tweens.length;
time = time !== undefined ? time : ( typeof window !== 'undefined' && window.performance !== undefined && window.performance.now !== undefined ? window.performance.now() : Date.now() );
while ( i < numTweens ) {
if ( _tweens[ i ].update( time ) ) {
if ( _tweens[ i ].update( this.game.time.now ) ) {
i ++;