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
b35a62d8
Commit
b35a62d8
authored
May 06, 2018
by
Shawn Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asldjoasd
parent
48a42560
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
44 deletions
+44
-44
Controller.ts
fe/src/Controller.ts
+41
-40
GameScene.ts
fe/src/scenes/GameScene.ts
+3
-4
No files found.
fe/src/Controller.ts
View file @
b35a62d8
class
Controller
extends
egret
.
Sprite
{
private
myPosition
=
{}
public
constructor
()
{
public
constructor
(
isCatcher
)
{
super
();
this
.
init
()
this
.
init
(
isCatcher
)
}
private
control
=
new
egret
.
Bitmap
()
...
...
@@ -14,54 +14,55 @@ class Controller extends egret.Sprite {
private
right
=
new
egret
.
Shape
()
// 初始化(给开始按钮绑定点击事件)
private
init
()
{
private
init
(
isCatcher
)
{
this
.
panel
.
graphics
.
beginFill
(
0x
353E5D
,
1
)
this
.
panel
.
graphics
.
beginFill
(
0x
00ff00
,
1
)
this
.
panel
.
graphics
.
drawRect
(
1008
,
0
,
326
,
750
)
this
.
panel
.
graphics
.
endFill
()
this
.
addChild
(
this
.
panel
)
let
texture
:
egret
.
Texture
=
RES
.
getRes
(
"control_jpg"
)
this
.
control
.
texture
=
texture
if
(
!
isCatcher
){
let
texture
:
egret
.
Texture
=
RES
.
getRes
(
"control_jpg"
)
this
.
control
.
texture
=
texture
let
controlContainer
=
new
egret
.
Sprite
()
this
.
addChild
(
controlContainer
)
controlContainer
.
x
=
1040
controlContainer
.
y
=
450
controlContainer
.
addChild
(
this
.
control
)
let
controlContainer
=
new
egret
.
Sprite
()
this
.
addChild
(
controlContainer
)
controlContainer
.
x
=
1040
controlContainer
.
y
=
450
controlContainer
.
addChild
(
this
.
control
)
this
.
up
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
up
.
graphics
.
drawRect
(
93
,
0
,
80
,
80
)
this
.
up
.
graphics
.
endFill
()
this
.
up
.
touchEnabled
=
true
this
.
up
.
alpha
=
0
this
.
up
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
up
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
up
.
graphics
.
drawRect
(
93
,
0
,
80
,
80
)
this
.
up
.
graphics
.
endFill
()
this
.
up
.
touchEnabled
=
true
this
.
up
.
alpha
=
0
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
.
alpha
=
0
this
.
down
.
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
.
alpha
=
0
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
.
alpha
=
0
this
.
left
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
lef
t
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
left
.
graphics
.
drawRect
(
0
,
93
,
80
,
80
)
this
.
lef
t
.
graphics
.
endFill
()
this
.
lef
t
.
touchEnabled
=
true
this
.
lef
t
.
alpha
=
0
this
.
lef
t
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
righ
t
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
right
.
graphics
.
drawRect
(
186
,
93
,
80
,
80
)
this
.
righ
t
.
graphics
.
endFill
()
this
.
righ
t
.
touchEnabled
=
true
this
.
righ
t
.
alpha
=
0
this
.
righ
t
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
right
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
right
.
graphics
.
drawRect
(
186
,
93
,
80
,
80
)
this
.
right
.
graphics
.
endFill
()
this
.
right
.
touchEnabled
=
true
this
.
right
.
alpha
=
0
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
)
controlContainer
.
addChild
(
this
.
up
)
controlContainer
.
addChild
(
this
.
down
)
controlContainer
.
addChild
(
this
.
left
)
controlContainer
.
addChild
(
this
.
right
)
}
const
me
=
Store
.
getState
().
runners
.
find
(
runner
=>
runner
.
t_cid
===
Store
.
getState
().
cid
)
...
...
fe/src/scenes/GameScene.ts
View file @
b35a62d8
...
...
@@ -16,11 +16,10 @@ class GameScene extends egret.Sprite {
bg
.
graphics
.
drawRect
(
0
,
0
,
1334
,
750
)
bg
.
graphics
.
endFill
()
this
.
addChild
(
bg
)
if
(
!
Store
.
isCatcher
())
{
this
.
controller
=
new
Controller
()
//
if (!Store.isCatcher()) {
this
.
controller
=
new
Controller
(
Store
.
isCatcher
()
)
this
.
addChild
(
this
.
controller
)
}
// }
this
.
map
=
new
Map
()
this
.
map
.
y
=
15
this
.
map
.
x
=
10
...
...
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