Commit 1eebe1f6 by Nick An

Merge branch 'develop' of cd.i.strikingly.com:shawn.wang/crazyflirt into develop

parents 1cf4776c 659607b4
<?xml version="1.0" encoding="UTF-8"?>
<module type="RUBY_MODULE" version="4">
<component name="ModuleRunConfigurationManager">
<shared />
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.16.0, rbenv: 2.2.2) [gem]" level="application" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.2.2" project-jdk-type="RUBY_SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/crazyflirt.iml" filepath="$PROJECT_DIR$/.idea/crazyflirt.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="98c1c367-feef-4919-9da2-788376ca83b3" name="Default" comment="">
<change beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
</list>
<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>
<file leaf-file-name="index.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/be/index.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690">
<caret line="46" column="17" lean-forward="false" selection-start-line="46" selection-start-column="17" selection-end-line="46" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="webserver.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/be/webserver.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="16" lean-forward="false" selection-start-line="0" selection-start-column="9" selection-end-line="0" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Gemfile" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" column="0" lean-forward="false" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</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$/Gemfile" />
<option value="$PROJECT_DIR$/be/index.rb" />
</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="ProjectFrameBounds">
<option name="y" value="23" />
<option name="width" value="1440" />
<option name="height" value="813" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="crazyflirt" type="b2602c69:ProjectViewProjectNode" />
<item name="crazyflirt" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crazyflirt" type="b2602c69:ProjectViewProjectNode" />
<item name="crazyflirt" type="462c0819:PsiDirectoryNode" />
<item name="be" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="editor.preferences.import" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</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="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="98c1c367-feef-4919-9da2-788376ca83b3" name="Default" comment="" />
<created>1525431962976</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1525431962976</updated>
<workItem from="1525431964973" duration="5582000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="5582000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="813" extended-state="6" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3294964" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" 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" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</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 />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" column="0" lean-forward="false" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/be/webserver.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="16" lean-forward="false" selection-start-line="0" selection-start-column="9" selection-end-line="0" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/be/index.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690">
<caret line="46" column="17" lean-forward="false" selection-start-line="46" selection-start-column="17" selection-end-line="46" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.3.0'
gemspec
gem 'faye-websocket'
gem 'sinatra'
gem 'rack'
gem 'thin'
GEM
remote: https://rubygems.org/
specs:
PLATFORMS
ruby
DEPENDENCIES
BUNDLED WITH
1.16.0
{
"groups":[
"groups": [
{
"keys":"bg_jpg,egret_icon_png,description_json",
"name":"preload"
}],
"resources":[
"keys": "bg_jpg,egret_icon_png,description_json,control_jpg,grid_jpg",
"name": "preload"
}
],
"resources": [
{
"name":"bg_jpg",
"type":"image",
"url":"assets/bg.jpg"
"name": "bg_jpg",
"type": "image",
"url": "assets/bg.jpg"
},
{
"name":"egret_icon_png",
"type":"image",
"url":"assets/egret_icon.png"
"name": "egret_icon_png",
"type": "image",
"url": "assets/egret_icon.png"
},
{
"name":"description_json",
"type":"json",
"url":"config/description.json"
}]
"name": "description_json",
"type": "json",
"url": "config/description.json"
},
{
"name": "control_jpg",
"type": "image",
"url": "assets/control.jpg"
},
{
"name": "grid_jpg",
"type": "image",
"url": "assets/grid.jpg"
}
]
}
\ No newline at end of file
......@@ -4,59 +4,78 @@ class Controller extends egret.Sprite {
this.init()
}
private speed = 10
private speedX = 0
private speedY = 0
private p1:egret.Point = new egret.Point();
private p2:egret.Point = new egret.Point();
private control = new egret.Shape();
private pointtt = new egret.Shape();
private controlCenter = new egret.Point(1100, 450)
private control = new egret.Bitmap()
private panel = new egret.Shape()
private pointtt = new egret.Shape()
private up = new egret.Shape()
private down = new egret.Shape()
private left = new egret.Shape()
private right = new egret.Shape()
// 初始化(给开始按钮绑定点击事件)
private init() {
this.control.graphics.beginFill( 0xFF3866, 1);
this.control.graphics.drawCircle(1100, 450, 90);
this.control.graphics.endFill();
this.addChild( this.control );
this.panel.graphics.beginFill(0x353E5D, 1)
this.panel.graphics.drawRect(1008, 0, 326, 750)
this.panel.graphics.endFill()
this.addChild(this.panel)
this.pointtt.graphics.beginFill(0xFF0000, 1)
this.pointtt.graphics.drawCircle(1100, 450, 10)
this.pointtt.graphics.drawCircle(667, 375, 15)
this.pointtt.graphics.endFill()
this.addChild(this.pointtt)
this.touchEnabled = true
this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.controlTouchBegin, this)
this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.controlTouchMove, this)
this.addEventListener(egret.TouchEvent.TOUCH_END, this.controlTouchEnd, this)
this.addEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this)
}
let texture: egret.Texture = RES.getRes("control_jpg")
this.control.texture = texture
private onEnterFrame(e: egret.Event){
if(this.touchEnd){
return
}
this.pointtt.x += this.speedX
this.pointtt.y += this.speedY
}
let controlContainer = new egret.Sprite()
this.addChild(controlContainer)
controlContainer.x = 1040
controlContainer.y = 450
controlContainer.addChild(this.control)
private touchEnd = false
private controlTouchBegin(e: egret.TouchEvent){
this.touchEnd = false
}
this.up.graphics.beginFill(0xFF00FF, 1)
this.up.graphics.drawRect(93, 0, 80, 80)
this.up.graphics.endFill()
this.up.touchEnabled = true
this.up.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.controlTouchBegin, this)
this.down.graphics.beginFill(0xFF00FF, 1)
this.down.graphics.drawRect(93, 186, 80, 80)
this.down.graphics.endFill()
this.down.touchEnabled = true
this.down.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.controlTouchBegin, this)
this.left.graphics.beginFill(0xFF00FF, 1)
this.left.graphics.drawRect(0, 93, 80, 80)
this.left.graphics.endFill()
this.left.touchEnabled = true
this.left.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.controlTouchBegin, this)
private controlTouchMove(e: egret.TouchEvent){
var angle = Math.atan2(e.stageY - this.controlCenter.y, e.stageX - this.controlCenter.x )
// console.error(e)
this.speedX = Math.cos(angle)*this.speed;
this.speedY = Math.sin(angle)*this.speed;
// console.error(this.speedX)
// console.error(e.stageX)
this.right.graphics.beginFill(0xFF00FF, 1)
this.right.graphics.drawRect(186, 93, 80, 80)
this.right.graphics.endFill()
this.right.touchEnabled = true
this.right.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.controlTouchBegin, this)
controlContainer.addChild(this.up)
controlContainer.addChild(this.down)
controlContainer.addChild(this.left)
controlContainer.addChild(this.right)
}
private controlTouchEnd(e: egret.TouchEvent){
this.touchEnd = true
// this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
private delta = 72
private controlTouchBegin(e: egret.TouchEvent){
if(e.currentTarget === this.up){
this.pointtt.y += this.delta
}else if(e.currentTarget === this.down){
this.pointtt.y -= this.delta
}else if(e.currentTarget === this.left){
this.pointtt.x -= this.delta
}else if(e.currentTarget === this.right){
this.pointtt.x += this.delta
}
}
public release() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment