Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
1b09c30f
Commit
1b09c30f
authored
Jul 16, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wordspace'
parents
649fd294
7ed81329
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
6 deletions
+23
-6
wordbreak.png
assets/image/word/wordbreak.png
+0
-0
player.png
assets/placeholder/player.png
+0
-0
roomBackground.png
assets/placeholder/roomBackground.png
+0
-0
Client.js
js/Client.js
+1
-0
ScenesData.js
js/ScenesData.js
+9
-1
WordObject.js
js/WordObject.js
+6
-1
WordSpace.js
js/WordSpace.js
+6
-3
server.js
server.js
+1
-1
No files found.
assets/image/word/wordbreak.png
0 → 100644
View file @
1b09c30f
47.9 KB
assets/placeholder/player.png
0 → 100644
View file @
1b09c30f
10.2 KB
assets/placeholder/roomBackground.png
0 → 100644
View file @
1b09c30f
41 KB
js/Client.js
View file @
1b09c30f
...
...
@@ -82,6 +82,7 @@ socket.on('gameEnd', function(msg) // object player
socket
.
on
(
'
attackSucceed
'
,
function
(
msg
)
{
console
.
log
(
'
client
'
);
let
tempWord
=
WordSpace
.
generateWord
.
Name
(
ScenesData
.
gameScene
,
true
,
msg
.
victim
);
tempWord
.
destroy
();
});
...
...
js/ScenesData.js
View file @
1b09c30f
...
...
@@ -123,7 +123,14 @@ var gameScene = new Phaser.Class(
}
});
console
.
log
(
RoomData
.
myself
);
WordSpace
.
test
=
WordSpace
.
generateWord
.
Name
(
this
,
false
,
null
);
WordSpace
.
attackGauge
.
add
(
11
);
WordSpace
.
wordBreakAnim
=
this
.
anims
.
create
({
key
:
'
break
'
,
frames
:
this
.
anims
.
generateFrameNumbers
(
'
wordBreak
'
),
frameRate
:
10
,
repeat
:
0
,
hideOnComplete
:
false
});
},
update
:
function
()
...
...
@@ -140,6 +147,7 @@ var gameScene = new Phaser.Class(
let
tempNames
=
''
;
WordSpace
.
nameGroup
.
forEach
(
function
(
element
)
{
//테스트용
tempNames
+=
element
.
wordText
+
(
element
.
isStrong
?
'
[강]
'
:
''
)
+
'
\n
'
;
});
...
...
js/WordObject.js
View file @
1b09c30f
...
...
@@ -30,7 +30,7 @@ class WordObject
}
else
{
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
random
.
x
,
random
.
y
,
'
nameBgr
'
+
Math
.
min
(
Math
.
max
(
2
,
this
.
wordText
.
length
),
6
))
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
random
.
x
,
random
.
y
,
(
this
.
isStrong
?
'
strongBgr
'
:
'
nameBgr
'
)
+
Math
.
min
(
Math
.
max
(
2
,
this
.
wordText
.
length
),
6
))
.
setMass
(
this
.
wordWeight
*
10
)
.
setScale
(
this
.
scale
)
.
setFrictionX
(
0
)
...
...
@@ -70,6 +70,10 @@ class WordObject
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
);
let
breakAnim
=
ScenesData
.
gameScene
.
add
.
sprite
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
'
wordBreak
'
).
setScale
(
0.5
).
setDepth
(
3
).
play
(
'
break
'
);
setTimeout
(
function
()
{
breakAnim
.
destroy
();
},
200
);
if
(
!
this
.
isNameWord
)
{
this
.
wordObj
.
destroy
();
...
...
@@ -158,6 +162,7 @@ class AttackWord extends WordObject
}
if
(
WordSpace
.
gameTimer
.
now
<
this
.
counterTime
)
{
console
.
log
(
this
.
attacker
);
let
tempWord
=
WordSpace
.
generateWord
.
Name
(
ScenesData
.
gameScene
,
true
,
this
.
attacker
);
tempWord
.
destroy
();
}
...
...
js/WordSpace.js
View file @
1b09c30f
...
...
@@ -14,6 +14,7 @@ WordSpace.totalWordNum = 0;
WordSpace
.
brainCapacity
=
200
;
//수용 가능한 단어 무게 최대치
WordSpace
.
gameTimer
=
null
;
//현재 게임 플레이 시간 타이머
WordSpace
.
isTimerOn
=
false
;
WordSpace
.
wordBreakAnim
=
null
;
WordSpace
.
wordGroup
=
[];
WordSpace
.
nameGroup
=
[];
...
...
@@ -238,9 +239,11 @@ WordSpace.loadImage = function(scene)
for
(
let
i
=
2
;
i
<
7
;
i
++
)
{
scene
.
load
.
image
(
'
nameBgr
'
+
i
,
'
assets/placeholder/name
'
+
i
+
'
.png
'
);
scene
.
load
.
image
(
'
strongBgr
'
+
i
,
'
assets/placeholder/strong
'
+
i
+
'
.png
'
);
}
scene
.
load
.
spritesheet
(
'
wordBreak
'
,
'
assets/image/word/wordbreak.png
'
,
{
frameWidth
:
180
,
frameHeight
:
180
});
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
100
,
75
,
'
뇌의 무게: (현재) 0 /
100
(전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
WordSpace
.
weightTextObjForTest
=
scene
.
add
.
text
(
100
,
75
,
'
뇌의 무게: (현재) 0 /
'
+
this
.
brainCapacity
+
'
(전체)
'
).
setDepth
(
10
).
setColor
(
'
#000000
'
);
WordSpace
.
killLogTextForTest
=
scene
.
add
.
text
(
1000
,
50
,
WordSpace
.
killLogForTest
).
setDepth
(
10
).
setColor
(
'
#000000
'
).
setAlign
(
'
right
'
);
}
...
...
@@ -368,7 +371,7 @@ WordSpace.findWord = function(wordText)
{
roomNum
:
RoomData
.
roomNum
,
victim
:
RoomData
.
myself
,
target
:
element
.
attacker
.
id
Num
target
:
element
.
attacker
.
id
}
socket
.
emit
(
'
defenseFailed
'
,
victimData
);
return
true
;
...
...
@@ -406,7 +409,7 @@ WordSpace.attack = function(wordText, grade)
let
attackData
=
{
roomNum
:
RoomData
.
roomNum
,
attacker
:
PlayerData
,
attacker
:
RoomData
.
myself
,
target
:
element
.
ownerId
,
text
:
wordText
,
grade
:
grade
,
...
...
server.js
View file @
1b09c30f
...
...
@@ -89,7 +89,7 @@ io.on('connection', function(socket)
{
let
dataToPush
=
{
attackerId
:
msg
.
attacker
.
id
Num
,
attackerId
:
msg
.
attacker
.
id
,
attacker
:
msg
.
attacker
.
nickname
,
word
:
msg
.
text
,
wordGrade
:
msg
.
grade
,
...
...
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