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
3cf276e6
Commit
3cf276e6
authored
May 06, 2018
by
Mike Zhu
Browse files
Options
Browse Files
Download
Plain Diff
tMerge branch 'develop' of cd.i.strikingly.com:shawn.wang/crazyflirt into develop
parents
ff440dd6
e6b81a06
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
22 deletions
+33
-22
Avatar.ts
fe/src/Avatar.ts
+15
-3
AvatarGroup.ts
fe/src/AvatarGroup.ts
+4
-4
Map.ts
fe/src/Map.ts
+10
-10
GameScene.ts
fe/src/scenes/GameScene.ts
+3
-4
RoomScene.ts
fe/src/scenes/RoomScene.ts
+1
-1
No files found.
fe/src/Avatar.ts
View file @
3cf276e6
class
Avatar
extends
egret
.
Sprite
{
public
constructor
(
userData
)
{
public
constructor
(
userData
,
showName
)
{
super
()
this
.
init
(
userData
)
this
.
init
(
userData
,
showName
)
}
private
avatar
=
new
egret
.
Bitmap
()
private
bg
=
new
egret
.
Bitmap
()
private
imageLoader
=
new
egret
.
ImageLoader
()
private
nameLabel
=
new
egret
.
TextField
()
private
init
(
userData
)
{
private
init
(
userData
,
showName
)
{
this
.
bg
.
width
=
100
this
.
bg
.
height
=
100
this
.
bg
.
texture
=
RES
.
getRes
(
"avatar_bg_jpg"
)
...
...
@@ -23,6 +25,16 @@ class Avatar extends egret.Sprite {
this
.
imageLoader
.
load
(
userData
.
avatar_url
||
"http://www.insajderi.com/wp-content/uploads/2018/01/asdja.jpg"
)
this
.
addChild
(
this
.
avatar
)
if
(
showName
){
this
.
nameLabel
.
text
=
userData
.
nick_name
this
.
nameLabel
.
width
=
100
this
.
nameLabel
.
textAlign
=
egret
.
HorizontalAlign
.
CENTER
;
this
.
nameLabel
.
x
=
0
this
.
nameLabel
.
size
=
16
this
.
nameLabel
.
y
=
100
this
.
addChild
(
this
.
nameLabel
);
}
}
private
loadCompleteHandler
()
{
...
...
fe/src/AvatarGroup.ts
View file @
3cf276e6
class
AvatarGroup
extends
egret
.
Sprite
{
public
constructor
(
userDatas
)
{
public
constructor
(
userDatas
,
showName
=
false
)
{
super
()
this
.
init
(
userDatas
)
this
.
init
(
userDatas
,
showName
)
}
private
init
(
userDatas
)
{
private
init
(
userDatas
,
showName
)
{
userDatas
.
forEach
((
userData
,
index
)
=>
{
let
avatar
=
new
Avatar
(
userData
)
let
avatar
=
new
Avatar
(
userData
,
showName
)
avatar
.
x
=
index
*
100
this
.
addChild
(
avatar
)
})
...
...
fe/src/Map.ts
View file @
3cf276e6
...
...
@@ -96,19 +96,19 @@ class Map extends egret.Sprite {
centerGrid
.
bg
.
texture
=
RES
.
getRes
(
'grid_select_jpg'
)
const
runners
=
Store
.
getState
().
runners
//
this.touchArea.alpha = 1
this
.
touchArea
.
alpha
=
1
this
.
touchArea
.
x
=
x
-
2
*
gridWidth
this
.
touchArea
.
y
=
y
-
2
*
gridHeight
// surroundedGrids.forEach(grid => {
// grid.alpha = 1
// })
const
twTouchArea
=
egret
.
Tween
.
get
(
this
.
touchArea
);
twTouchArea
.
to
(
{
alpha
:
1
},
300
).
call
(
function
()
{
surroundedGrids
.
forEach
(
grid
=>
{
grid
.
alpha
=
1
})
// egret.Tween.get(grid).to({ alpha: 1 }, 300)
surroundedGrids
.
forEach
(
grid
=>
{
grid
.
alpha
=
1
})
// const twTouchArea = egret.Tween.get( this.touchArea );
// twTouchArea.to( {alpha: 1}, 300 ).call(function() {
// surroundedGrids.forEach(grid => {
// grid.alpha = 1
// })
// // egret.Tween.get(grid).to({ alpha: 1 }, 300)
// })
// surroundedGrids.forEach(grid => {
// egret.Tween.get(grid).to({ alpha: 1 }, 300)
// })
...
...
fe/src/scenes/GameScene.ts
View file @
3cf276e6
...
...
@@ -16,14 +16,13 @@ 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
(
Store
.
isCatcher
())
this
.
addChild
(
this
.
controller
)
// }
this
.
map
=
new
Map
()
this
.
map
.
y
=
15
this
.
map
.
x
=
10
this
.
addChild
(
this
.
map
)
this
.
controller
=
new
Controller
(
Store
.
isCatcher
())
this
.
addChild
(
this
.
controller
)
}
public
release
()
{
...
...
fe/src/scenes/RoomScene.ts
View file @
3cf276e6
...
...
@@ -61,7 +61,7 @@ class RoomScene extends egret.Sprite {
if
(
this
.
avatars
&&
this
.
avatars
.
parent
){
this
.
avatars
.
parent
.
removeChild
(
this
.
avatars
)
}
this
.
avatars
=
new
AvatarGroup
(
members
)
this
.
avatars
=
new
AvatarGroup
(
members
,
true
)
this
.
avatars
.
y
=
330
this
.
avatars
.
x
=
667
-
(
members
.
length
*
100
)
/
2
this
.
addChild
(
this
.
avatars
)
...
...
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