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
c6a417b5
Commit
c6a417b5
authored
May 05, 2018
by
Mike Zhu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of cd.i.strikingly.com:shawn.wang/crazyflirt into develop
parents
616e4cb8
354e8916
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
6 deletions
+24
-6
mask.jpg
fe/resource/assets/mask.jpg
+0
-0
default.res.json
fe/resource/default.res.json
+7
-1
Controller.ts
fe/src/Controller.ts
+4
-0
Guy.ts
fe/src/Guy.ts
+4
-4
GameScene.ts
fe/src/scenes/GameScene.ts
+9
-1
No files found.
fe/resource/assets/mask.jpg
0 → 100644
View file @
c6a417b5
141 KB
fe/resource/default.res.json
View file @
c6a417b5
{
{
"groups"
:
[
"groups"
:
[
{
{
"keys"
:
"bg_jpg,egret_icon_png,description_json,control_jpg,grid_jpg,logo_jpg"
,
"keys"
:
"bg_jpg,egret_icon_png,description_json,control_jpg,grid_jpg,logo_jpg
,mask_jpg
"
,
"name"
:
"preload"
"name"
:
"preload"
}
}
],
],
...
@@ -35,6 +35,11 @@
...
@@ -35,6 +35,11 @@
"name"
:
"logo_jpg"
,
"name"
:
"logo_jpg"
,
"type"
:
"image"
,
"type"
:
"image"
,
"url"
:
"assets/logo.jpg"
"url"
:
"assets/logo.jpg"
},
{
"name"
:
"mask_jpg"
,
"type"
:
"image"
,
"url"
:
"assets/mask.jpg"
}
}
]
]
}
}
\ No newline at end of file
fe/src/Controller.ts
View file @
c6a417b5
...
@@ -33,24 +33,28 @@ class Controller extends egret.Sprite {
...
@@ -33,24 +33,28 @@ class Controller extends egret.Sprite {
this
.
up
.
graphics
.
drawRect
(
93
,
0
,
80
,
80
)
this
.
up
.
graphics
.
drawRect
(
93
,
0
,
80
,
80
)
this
.
up
.
graphics
.
endFill
()
this
.
up
.
graphics
.
endFill
()
this
.
up
.
touchEnabled
=
true
this
.
up
.
touchEnabled
=
true
this
.
up
.
alpha
=
0
this
.
up
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
up
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
down
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
down
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
down
.
graphics
.
drawRect
(
93
,
186
,
80
,
80
)
this
.
down
.
graphics
.
drawRect
(
93
,
186
,
80
,
80
)
this
.
down
.
graphics
.
endFill
()
this
.
down
.
graphics
.
endFill
()
this
.
down
.
touchEnabled
=
true
this
.
down
.
touchEnabled
=
true
this
.
down
.
alpha
=
0
this
.
down
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
down
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
left
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
left
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
left
.
graphics
.
drawRect
(
0
,
93
,
80
,
80
)
this
.
left
.
graphics
.
drawRect
(
0
,
93
,
80
,
80
)
this
.
left
.
graphics
.
endFill
()
this
.
left
.
graphics
.
endFill
()
this
.
left
.
touchEnabled
=
true
this
.
left
.
touchEnabled
=
true
this
.
left
.
alpha
=
0
this
.
left
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
left
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
right
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
right
.
graphics
.
beginFill
(
0xFF00FF
,
1
)
this
.
right
.
graphics
.
drawRect
(
186
,
93
,
80
,
80
)
this
.
right
.
graphics
.
drawRect
(
186
,
93
,
80
,
80
)
this
.
right
.
graphics
.
endFill
()
this
.
right
.
graphics
.
endFill
()
this
.
right
.
touchEnabled
=
true
this
.
right
.
touchEnabled
=
true
this
.
right
.
alpha
=
0
this
.
right
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
this
.
right
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
controlTouchBegin
,
this
)
controlContainer
.
addChild
(
this
.
up
)
controlContainer
.
addChild
(
this
.
up
)
...
...
fe/src/Guy.ts
View file @
c6a417b5
...
@@ -29,11 +29,11 @@ class Guy extends egret.Sprite {
...
@@ -29,11 +29,11 @@ class Guy extends egret.Sprite {
if
(
this
.
x
<=
0
){
if
(
this
.
x
<=
0
){
this
.
x
=
0
this
.
x
=
0
}
}
if
(
this
.
y
<=
0
){
if
(
this
.
y
<=
15
){
this
.
y
=
0
this
.
y
=
15
}
}
if
(
this
.
y
>=
72
*
9
){
if
(
this
.
y
>=
72
*
9
+
15
){
this
.
y
=
72
*
9
this
.
y
=
72
*
9
+
15
}
}
if
(
this
.
x
>=
72
*
13
){
if
(
this
.
x
>=
72
*
13
){
this
.
x
=
72
*
13
this
.
x
=
72
*
13
...
...
fe/src/scenes/GameScene.ts
View file @
c6a417b5
...
@@ -12,15 +12,23 @@ class GameScene extends egret.Sprite {
...
@@ -12,15 +12,23 @@ class GameScene extends egret.Sprite {
// 初始化(给开始按钮绑定点击事件)
// 初始化(给开始按钮绑定点击事件)
private
init
()
{
private
init
()
{
// put display object to this scene
// put display object to this scene
let
bg
=
new
egret
.
Shape
()
bg
.
graphics
.
beginFill
(
0x343e5f
,
1
)
bg
.
graphics
.
drawRect
(
0
,
0
,
1334
,
750
)
bg
.
graphics
.
endFill
()
this
.
addChild
(
bg
)
this
.
controller
=
new
Controller
()
this
.
controller
=
new
Controller
()
this
.
addChild
(
this
.
controller
)
this
.
addChild
(
this
.
controller
)
this
.
controller
.
addEventListener
(
"position_change"
,
this
.
onPositionChange
,
this
)
this
.
controller
.
addEventListener
(
"position_change"
,
this
.
onPositionChange
,
this
)
this
.
map
=
new
Map
()
this
.
map
=
new
Map
()
this
.
map
.
y
=
15
this
.
me
.
y
=
15
this
.
addChild
(
this
.
map
)
this
.
addChild
(
this
.
map
)
this
.
addChild
(
this
.
me
)
this
.
addChild
(
this
.
me
)
}
}
private
onPositionChange
(
delta
){
private
onPositionChange
(
delta
){
this
.
me
.
applyDelta
(
delta
.
data
)
this
.
me
.
applyDelta
(
delta
.
data
)
}
}
...
...
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