Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
M
mangala-pardusacikhack
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Tuğba Fıçıcı
mangala-pardusacikhack
Commits
3f3598a5
Kaydet (Commit)
3f3598a5
authored
May 07, 2021
tarafından
Abdülkerim AKSAK
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Oda sahibi username karşılama.
üst
2d2e04e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
data.json
data.json
+2
-0
clientGameArea.js
pages/clientGameArea.js
+16
-10
No files found.
data.json
Dosyayı görüntüle @
3f3598a5
{
"user_name"
:
"Haydut"
,
"score_list"
:[],
"zorluk_setting"
:
"Kolay"
}
\ No newline at end of file
pages/clientGameArea.js
Dosyayı görüntüle @
3f3598a5
...
...
@@ -25,8 +25,8 @@ user2hole.push(treasure2);
var
player
=
2
;
waitcolor
=
"#ed664c"
;
//// Kırmızı renk beklesin
playercolor
=
"#ffe268"
;
// Sarı renk oynasın
waitvisible
=
"visible"
;
playervisible
=
"hidden"
;
waitvisible
=
"visible"
;
playervisible
=
"hidden"
;
function
tikla
(
id
)
{
// ekranda bulunan kuyulardaki kuyulara tıklama ile tetiklenen fonk.
...
...
@@ -41,8 +41,8 @@ function tikla(id) {
if
(
player
==
2
)
{
document
.
getElementById
(
"user1"
).
style
.
backgroundColor
=
waitcolor
;
document
.
getElementById
(
"user2"
).
style
.
backgroundColor
=
playercolor
;
document
.
getElementById
(
"clock1"
).
style
.
visibility
=
playervisible
;
document
.
getElementById
(
"clock2"
).
style
.
visibility
=
waitvisible
;
document
.
getElementById
(
"clock1"
).
style
.
visibility
=
playervisible
;
document
.
getElementById
(
"clock2"
).
style
.
visibility
=
waitvisible
;
}
//sendMessage(Number(id[9]));
}
...
...
@@ -56,8 +56,8 @@ function tikla(id) {
if
(
player
==
1
)
{
document
.
getElementById
(
"user1"
).
style
.
backgroundColor
=
playercolor
;
document
.
getElementById
(
"user2"
).
style
.
backgroundColor
=
waitcolor
;
document
.
getElementById
(
"clock1"
).
style
.
visibility
=
waitvisible
;
document
.
getElementById
(
"clock2"
).
style
.
visibility
=
playervisible
;
document
.
getElementById
(
"clock1"
).
style
.
visibility
=
waitvisible
;
document
.
getElementById
(
"clock2"
).
style
.
visibility
=
playervisible
;
}
sendMessage
(
Number
(
id
[
9
]));
}
...
...
@@ -377,7 +377,7 @@ let game = io.connect("https://mangala-server.herokuapp.com/game");
//let game = io.connect("http://localhost:3000/game");
//username cekme
const
name
=
require
(
"./settings.js"
);
const
name
=
require
(
"./settings.js"
);
const
username
=
name
.
getUsername
();
console
.
log
(
name
.
getUsername
());
...
...
@@ -416,9 +416,11 @@ function overlayOda() {
let
elemt3
=
document
.
createElement
(
"p"
);
let
odaGirisi
=
document
.
getElementById
(
"odaGirisi"
);
game
.
on
(
"newUser"
,
(
username
)
=>
{
elemt3
.
textContent
=
username
+
" odaya katıldı."
;
createNotification
(
username
+
" odaya katıldı."
);
game
.
on
(
"newUser"
,
(
userNew
)
=>
{
elemt3
.
textContent
=
userNew
+
" odaya katıldı."
;
game
.
emit
(
"sendUserName"
,
username
,
randomKey
);
// İkinci kullanıcı karşılama(isim yollama)
document
.
getElementById
(
"user1Name"
).
innerHTML
=
userNew
;
createNotification
(
userNew
+
" odaya katıldı."
);
});
//odaGirisi.appendChild(elemt3);
overlayOdaOff
();
...
...
@@ -485,3 +487,7 @@ game.on("newMessage", (msg) => {
console
.
log
(
`newMessage...: "
${
msg
}
" mesajı geldi.`
);
tikla
(
"user1hole"
+
msg
+
"x"
);
});
game
.
on
(
"newUserName"
,
(
username
)
=>
{
console
.
log
(
username
);
});
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