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
e7893b21
Commit
e7893b21
authored
Aug 17, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 킬로그가 UI로 제대로 뜸
parent
d503cacc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
20 deletions
+81
-20
GameServer.js
GameServer.js
+1
-1
Client.js
js/Client.js
+79
-12
ScenesData.js
js/ScenesData.js
+0
-2
WordSpace.js
js/WordSpace.js
+1
-5
No files found.
GameServer.js
View file @
e7893b21
...
...
@@ -82,7 +82,7 @@ class GameRoom
{
this
.
roomId
=
GameServer
.
getRoomNumber
();
this
.
roomIndex
=
-
1
;
this
.
startCount
=
2
;
this
.
startCount
=
3
;
this
.
maxPlayer
=
100
;
this
.
nextRank
=
100
;
...
...
js/Client.js
View file @
e7893b21
...
...
@@ -207,14 +207,54 @@ socket.on('defeat', function(msg) // object player
RoomData
.
players
[
msg
.
index
].
position
=
position
;
RoomData
.
players
[
msg
.
index
].
nicknameText
=
nicknameText
;
let
victim
=
RoomData
.
findPlayer
(
msg
.
id
);
RoomData
.
aliveCount
--
;
RoomData
.
findPlayer
(
msg
.
id
).
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
gameOver
]);
victim
.
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
gameOver
]);
if
(
msg
.
lastAttack
!=
null
)
{
let
lastAttacker
=
RoomData
.
findPlayer
(
msg
.
lastAttack
.
attackerId
).
nickname
;
console
.
log
(
RoomData
.
findPlayer
(
msg
.
id
).
nickname
+
'
defeated by
'
+
lastAttacker
+
'
, with
'
+
msg
.
lastAttack
.
word
);
WordSpace
.
killLogForTest
+=
(
'
\n
'
+
lastAttacker
+
'
--
'
+
msg
.
lastAttack
.
word
+
'
->
'
+
RoomData
.
findPlayer
(
msg
.
id
).
nickname
);
let
itemBag
=
ScenesData
.
gameScene
.
add
.
sprite
(
RoomData
.
findPlayer
(
msg
.
lastAttack
.
attackerId
).
position
.
x
,
RoomData
.
findPlayer
(
msg
.
lastAttack
.
attackerId
).
position
.
y
,
let
lastAttacker
=
RoomData
.
findPlayer
(
msg
.
lastAttack
.
attackerId
);
let
attackWord
=
msg
.
lastAttack
.
word
;
console
.
log
(
victim
.
nickname
+
'
defeated by
'
+
lastAttacker
.
nickname
+
'
, with
'
+
msg
.
lastAttack
.
word
);
if
(
WordSpace
.
lastAttackGroup
.
length
!=
0
)
{
WordSpace
.
lastAttackGroup
.
forEach
(
function
(
element
){
element
.
destroy
();
})
}
let
attackerLabel
=
UIObject
.
createLabel
(
ScenesData
.
gameScene
,
game
.
config
.
width
/
2
-
400
,
0
,
10.2
,
'
nameBgr
'
+
lastAttacker
.
nickname
.
length
,
2
,
'
center
'
,
lastAttacker
.
nickname
,
50
,
'
#ffffff
'
,
0.45
,
0.5
);
let
wordLabel
=
UIObject
.
createLabel
(
ScenesData
.
gameScene
,
game
.
config
.
width
/
2
,
0
,
10.2
,
'
wordBgr
'
+
msg
.
lastAttack
.
wordGrade
+
'
_
'
+
attackWord
.
length
,
2
,
'
center
'
,
attackWord
,
50
,
'
#000000
'
,
0.45
,
0.5
);
let
victimLabel
=
UIObject
.
createLabel
(
ScenesData
.
gameScene
,
game
.
config
.
width
/
2
+
400
,
0
,
10.2
,
'
nameBgr
'
+
victim
.
nickname
.
length
,
2
,
'
center
'
,
victim
.
nickname
,
50
,
'
#ffffff
'
,
0.45
,
0.5
);
WordSpace
.
lastAttackGroup
.
push
(
attackerLabel
);
WordSpace
.
lastAttackGroup
.
push
(
wordLabel
);
WordSpace
.
lastAttackGroup
.
push
(
victimLabel
);
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
[
attackerLabel
,
wordLabel
,
victimLabel
],
y
:
100
,
ese
:
'
Linear
'
,
duration
:
500
,
repeat
:
0
,
onComplete
:
function
()
{
setTimeout
(
function
()
{
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
[
attackerLabel
,
wordLabel
,
victimLabel
],
y
:
-
100
,
ease
:
'
Linear
'
,
// 'Cubic', 'Elastic', 'Bounce', 'Back'
duration
:
500
,
repeat
:
0
,
// -1: infinity
yoyo
:
false
});
},
1000
);
},
})
let
itemBag
=
ScenesData
.
gameScene
.
add
.
sprite
(
lastAttacker
.
position
.
x
,
lastAttacker
.
position
.
y
,
'
itemBag
'
).
setScale
(
0
).
setDepth
(
5.3
);
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
itemBag
,
...
...
@@ -233,10 +273,9 @@ socket.on('defeat', function(msg) // object player
ease
:
'
Linear
'
,
// 'Cubic', 'Elastic', 'Bounce', 'Back'
duration
:
500
,
repeat
:
0
,
// -1: infinity
yoyo
:
false
});
},
1500
);
},
onCompleteScope
:
ScenesData
.
gameScene
});
},
1000
);
}
});
setTimeout
(
function
()
{
itemBag
.
destroy
();
...
...
@@ -245,14 +284,42 @@ socket.on('defeat', function(msg) // object player
{
var
keys
=
Object
.
keys
(
Enums
.
item
);
WordSpace
.
generateWord
.
Item
(
ScenesData
.
gameScene
,
Enums
.
item
[
keys
[
keys
.
length
*
Math
.
random
()
<<
0
]]);
RoomData
.
myself
.
killCount
++
;
}
}
else
{
console
.
log
(
RoomData
.
findPlayer
(
msg
.
id
).
nickname
+
'
defeated
'
);
WordSpace
.
killLogForTest
+=
(
'
\n
--Suicide->
'
+
RoomData
.
findPlayer
(
msg
.
id
).
nickname
);
console
.
log
(
victim
.
nickname
+
'
defeated
'
);
if
(
WordSpace
.
lastAttackGroup
.
length
!=
0
)
{
WordSpace
.
lastAttackGroup
.
forEach
(
function
(
element
){
element
.
destroy
();
})
}
let
victimLabel
=
UIObject
.
createLabel
(
ScenesData
.
gameScene
,
game
.
config
.
width
/
2
,
0
,
10.2
,
'
nameBgr
'
+
victim
.
nickname
.
length
,
2
,
'
center
'
,
victim
.
nickname
,
50
,
'
#ffffff
'
,
0.45
,
0.5
);
WordSpace
.
lastAttackGroup
.
push
(
victimLabel
);
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
victimLabel
,
y
:
100
,
ese
:
'
Linear
'
,
duration
:
500
,
repeat
:
0
,
onComplete
:
function
()
{
setTimeout
(
function
()
{
ScenesData
.
gameScene
.
tweens
.
add
({
targets
:
victimLabel
,
y
:
-
100
,
ease
:
'
Linear
'
,
// 'Cubic', 'Elastic', 'Bounce', 'Back'
duration
:
500
,
repeat
:
0
,
// -1: infinity
});
},
1000
);
}
})
}
if
(
msg
.
id
==
RoomData
.
myself
.
id
)
{
...
...
js/ScenesData.js
View file @
e7893b21
...
...
@@ -432,7 +432,6 @@ var gameScene = new Phaser.Class(
});
WordSpace
.
resetGame
();
WordSpace
.
weightTextObjForTest
=
this
.
add
.
text
(
game
.
config
.
width
*
5
/
64
,
game
.
config
.
height
*
5
/
48
,
'
뇌의 무게: (현재) 0 /
'
+
this
.
brainCapacity
+
'
(전체)
'
).
setDepth
(
9.9
).
setColor
(
'
#000000
'
);
WordSpace
.
killLogTextForTest
=
this
.
add
.
text
(
game
.
config
.
width
*
25
/
32
,
game
.
config
.
height
*
5
/
72
,
WordSpace
.
killLogForTest
).
setDepth
(
9.9
).
setColor
(
'
#000000
'
).
setAlign
(
'
right
'
);
},
create
:
function
()
...
...
@@ -487,7 +486,6 @@ var gameScene = new Phaser.Class(
});
WordSpace
.
weightTextObjForTest
.
setText
(
'
뇌의 무게: (현재)
'
+
WordSpace
.
totalWeight
+
'
/
'
+
WordSpace
.
brainCapacity
+
'
(전체)
'
);
WordSpace
.
killLogTextForTest
.
setText
(
WordSpace
.
killLogForTest
);
WordSpace
.
setPlayerTyping
.
add
(
''
);
}
}
...
...
js/WordSpace.js
View file @
e7893b21
...
...
@@ -3,8 +3,6 @@ var WordSpace = WordSpace || {};
// for test
WordSpace
.
weightTextObjForTest
=
null
;
WordSpace
.
nameWordTextForTest
=
null
;
WordSpace
.
killLogTextForTest
=
null
;
WordSpace
.
killLogForTest
=
''
;
WordSpace
.
nextWordCode
=
0
;
WordSpace
.
totalWeight
=
0
;
//현재 단어 무게 총합
...
...
@@ -20,6 +18,7 @@ WordSpace.nameGroup = [];
WordSpace
.
attackPaperGroup
=
null
;
WordSpace
.
wordForcedGroup
=
[];
WordSpace
.
wordPhysicsGroup
=
null
;
WordSpace
.
lastAttackGroup
=
[];
WordSpace
.
GradeProb
=
[
0.35
,
0.6
,
0.8
];
WordSpace
.
Phase
=
{
READY
:
0
,
START
:
1
,
MAIN
:
2
,
MUSIC
:
3
};
...
...
@@ -502,7 +501,6 @@ WordSpace.changePhase = function(newPhase)
// 여기서 종이 닫으면됨
phaseChangeBgr
.
anims
.
playReverse
(
'
phase
'
+
newPhase
+
'
Anim
'
);
phaseChangeBgr
.
on
(
'
animationcomplete
'
,
function
(
currentAnim
,
currentFrame
,
sprite
){
sprite
.
destroy
()});
//phaseChangeBgr.destroy();
Audio
.
playSound
(
ScenesData
.
gameScene
,
'
startGame
'
);
//WordSpace.pauseCycle(false);
//console.log('start again');
...
...
@@ -512,8 +510,6 @@ WordSpace.resetGame = function()
{
WordSpace
.
weightTextObjForTest
=
null
;
WordSpace
.
nameWordTextForTest
=
null
;
WordSpace
.
killLogTextForTest
=
null
;
WordSpace
.
killLogForTest
=
''
;
WordSpace
.
nextWordCode
=
0
;
WordSpace
.
totalWeight
=
0
;
//현재 단어 무게 총합
...
...
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