Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crazyflirt
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shawn Wang
crazyflirt
Commits
15ec9eca
Commit
15ec9eca
authored
May 05, 2018
by
Matt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add global store
parent
c7c4ac86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
Main.ts
fe/src/Main.ts
+1
-0
Store.ts
fe/src/Store.ts
+20
-0
README.md
fe/src/scenes/README.md
+33
-0
No files found.
fe/src/Main.ts
View file @
15ec9eca
...
...
@@ -101,6 +101,7 @@ class Main extends egret.DisplayObjectContainer {
platform
.
onSocketMessage
(
function
(
res
)
{
console
.
log
(
'收到服务器内容:'
+
res
.
data
)
const
state
=
Store
.
onMessage
(
res
.
data
)
})
platform
.
onSocketError
((
e
)
=>
{
console
.
error
(
"onSocketError"
)
...
...
fe/src/Store.ts
0 → 100644
View file @
15ec9eca
const
_state
=
{}
class
Store
{
static
getState
()
{
return
_state
}
static
onMessage
(
message
)
{
switch
(
message
.
type
)
{
case
'start'
:
_state
=
{
}
break
;
default
:
break
;
}
return
_state
}
}
\ No newline at end of file
fe/src/scenes/README.md
0 → 100644
View file @
15ec9eca
{
type: 'moving', # 'start' , 'entry', 'clicking'
cid: 'abcdefg',
room_id: 'asdfadfaf',
payload: {
open_id: 'asdfasdfa',
picture: 'https://xxx.com',
x: 1,
y: 4
}
}
{
type: 'game_ready',
cid: 'abcdefg',
room_id: 'asdfadfaf',
payload: {
open_id: 'asdfasdfa',
picture: 'https://xxx.com',
role: 'ghost', # runner
}
}
GameScene
RunnerList
if isRunner
Controller
Map
if isCatcher
Map.mask = touchArea
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment