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
9e260d8d
Commit
9e260d8d
authored
Jul 08, 2019
by
18신대성
Committed by
18류지석
Jul 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
플레이어 데이터, 룸 데이터 모아둠 (main.js참고)
parent
aefee6ef
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
7 deletions
+16
-7
GameServer.js
GameServer.js
+1
-1
Client.js
js/Client.js
+1
-1
Input.js
js/Input.js
+1
-0
WordObject.js
js/WordObject.js
+1
-1
WordSpace.js
js/WordSpace.js
+2
-2
main.js
js/main.js
+10
-2
No files found.
GameServer.js
View file @
9e260d8d
var
GameServer
=
GameServer
||
{};
GameServer
.
Phase
=
{
READY
:
0
,
START
:
1
,
MAIN
:
2
,
MUSIC
:
3
};
GameServer
.
startCount
=
4
;
GameServer
.
startCount
=
1
;
GameServer
.
currentPlayer
=
[];
GameServer
.
playingRoom
=
[];
...
...
js/Client.js
View file @
9e260d8d
...
...
@@ -4,7 +4,7 @@ socket.emit('idRequest');
socket
.
on
(
'
idSet
'
,
function
(
msg
)
// {str, num playerNum}
{
console
.
log
(
msg
.
str
);
player
Num
=
msg
.
num
;
PlayerData
.
id
Num
=
msg
.
num
;
});
socket
.
on
(
'
setPlayerTypingRate
'
,
function
(
msg
)
// number playerTypingRate
{
...
...
js/Input.js
View file @
9e260d8d
...
...
@@ -29,6 +29,7 @@ Input.menuSceneEnterReaction = function()
if
(
Input
.
convInput
.
length
>
0
)
{
socket
.
emit
(
'
setNickname
'
,
Input
.
convInput
);
PlayerData
.
nickname
=
Input
.
convInput
;
Input
.
reset
();
game
.
scene
.
remove
(
'
menuScene
'
);
}
...
...
js/WordObject.js
View file @
9e260d8d
...
...
@@ -120,7 +120,7 @@ class AttackWord extends WordObject
this
.
wordGrade
=
_wordGrade
;
this
.
wordWeight
=
WordReader
.
getWordWeight
(
this
.
wordGrade
);
if
(
WordReader
.
getWordTyping
(
_attacker
)
<=
9
)
this
.
wordWeight
+=
this
.
wordWeight
*
0.2
*
(
WordReader
.
getWordTyping
(
playerN
ame
)
-
9
);
this
.
wordWeight
+=
this
.
wordWeight
*
0.2
*
(
WordReader
.
getWordTyping
(
PlayerData
.
nickn
ame
)
-
9
);
this
.
wordWeight
*=
isStrong
?
3
:
2
;
this
.
attacker
=
_attacker
;
//서버 사용하게 되면 PlayerTyping을 피격자의 것으로 바꿔야 함
...
...
js/WordSpace.js
View file @
9e260d8d
...
...
@@ -247,7 +247,7 @@ WordSpace.generateWord =
Name
:
function
(
scene
,
isStrong
,
lenRate
)
{
//To do
word
=
new
NameWord
(
playerN
ame
,
isStrong
);
word
=
new
NameWord
(
PlayerData
.
nickn
ame
,
isStrong
);
WordSpace
.
pushWord
(
scene
,
word
,
lenRate
);
}
}
...
...
@@ -359,7 +359,7 @@ WordSpace.attack = function(wordText, grade)
{
console
.
log
(
'
attack
'
+
wordText
+
'
, grade:
'
+
grade
);
//호패에 따른 isStrong 구분 필요함
WordSpace
.
generateWord
.
Attack
(
WordSpace
.
gameSceneForTest
,
wordText
,
grade
,
playerN
ame
,
true
);
WordSpace
.
generateWord
.
Attack
(
WordSpace
.
gameSceneForTest
,
wordText
,
grade
,
PlayerData
.
nickn
ame
,
true
);
//WordSpace.generateWord(WordSpace.gameSceneForTest, wordText, grade, undefined, true); // for test
// 이부분에서 게이지에 따라 급수 결정
// 이걸 서버로 공격을 보내야 함
...
...
js/main.js
View file @
9e260d8d
...
...
@@ -16,5 +16,13 @@ var game = new Phaser.Game(config)
//플레이어 정보, 서버 통신시 필요할 듯
//테스트용이므로 차후 수정 요망
var
playerNum
=
-
1
;
//플레이어 아이디, 고유 번호
var
playerName
=
'
임시아이디
'
//플레이어 닉네임
\ No newline at end of file
var
PlayerData
=
PlayerData
||
{};
PlayerData
.
idNum
=
-
1
;
//플레이어 아이디, 고유 번호
PlayerData
.
nickname
=
'
홍길동
'
;
//플레이어 닉네임
// 현재 들어가있는 Game Room의 정보
var
RoomData
=
RoomData
||
{};
RoomData
.
roomNum
=
-
1
;
RoomData
.
players
=
null
;
\ No newline at end of file
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