Stack Exchange
log in
users (10)
rooms (14)
faq
Zaedian
general
recent
conversations
JavaScript
Topic: Anything JavaScript, ECMAScript including Node, React, ...
3
Zaedian
Nov 8, 2019 14:28
thanks i will try this out
Zaedian
Nov 8, 2019 14:20
ohh ok
Zaedian
Nov 8, 2019 14:13
right
Zaedian
Nov 8, 2019 14:12
oh
Zaedian
Nov 8, 2019 14:12
wont draw outside it
Zaedian
Nov 8, 2019 14:12
hmm
Zaedian
Nov 8, 2019 14:11
thanks
Zaedian
Nov 8, 2019 14:11
ohh ok
Zaedian
Nov 8, 2019 14:11
you mean outside the draw function?
Zaedian
Nov 8, 2019 14:07
:/
Zaedian
Nov 8, 2019 14:07
now im also drawing the username constantly
Zaedian
Nov 8, 2019 14:07
thats better indeed
Zaedian
Nov 8, 2019 14:07
ohh right
Zaedian
Nov 8, 2019 14:06
I set px and py to 0 in drawGui.js
Zaedian
Nov 8, 2019 14:06
hmm
Zaedian
Nov 8, 2019 14:05
ohh
Zaedian
Nov 8, 2019 14:05
this is way harder than I expected
Zaedian
Nov 8, 2019 14:05
oh
Zaedian
Nov 8, 2019 14:04
undefined in left top
Zaedian
Nov 8, 2019 14:04
Zaedian
Nov 8, 2019 14:04
still same :(
Zaedian
Nov 8, 2019 14:03
ohh ok
Zaedian
Nov 8, 2019 14:01
nope didnt work for me XD
Zaedian
Nov 8, 2019 14:00
like var data.posX = callX;?
Zaedian
Nov 8, 2019 14:00
and save it in a new variable?
Zaedian
Nov 8, 2019 14:00
so in client.js above the console.log(data) I can create a function lets say: function(callXY) {
}
Zaedian
Nov 8, 2019 13:59
hmm
Zaedian
Nov 8, 2019 13:58
ohh
Zaedian
Nov 8, 2019 13:58
so its not possible to draw the current X and Y positions?
Zaedian
Nov 8, 2019 13:58
oh :/
Zaedian
Nov 8, 2019 13:57
however im trying to draw the X and Y position in drawGui.js
Zaedian
Nov 8, 2019 13:56
the console.log(data) then logs the following: {posX: 288, posY: 272, id: "x8oWnsrOmb76GPPyAAAE", dir: 0, isAnimating: false}
Zaedian
Nov 8, 2019 13:56
only in drawGui.js
Zaedian
Nov 8, 2019 13:56
no
Zaedian
Nov 8, 2019 13:55
I could send all my code if it maybe helps
Zaedian
Nov 8, 2019 13:55
but still undefined
Zaedian
Nov 8, 2019 13:55
I tried var px = client.data.posX;
Zaedian
Nov 8, 2019 13:55
var px = data.posY;
Zaedian
Nov 8, 2019 13:54
but in drawGui.js I have: var px and var py
Zaedian
Nov 8, 2019 13:54
server.on("playerMovement", function(data) {
server.send(data, "playerMovement");
});
Zaedian
Nov 8, 2019 13:54
this is in my server.js
Zaedian
Nov 8, 2019 13:53
all it does is output this: {posX: 288, posY: 272, id: "x8oWnsrOmb76GPPyAAAE", dir: 0, isAnimating: false}
Zaedian
Nov 8, 2019 13:53
yes
Zaedian
Nov 8, 2019 13:52
in client.js
Zaedian
Nov 8, 2019 13:51
I had console.log(data); commented out
Zaedian
Nov 8, 2019 13:51
ok
Zaedian
Nov 8, 2019 13:51
the code or the console output?
Zaedian
Nov 8, 2019 13:50
okay
Zaedian
Nov 8, 2019 13:49
sorry I dont know, im new to this coding
Zaedian
Nov 8, 2019 13:46
hey