diff options
author | jak1 <mike.wollmann@gmail.com> | 2021-08-02 00:12:08 +0200 |
---|---|---|
committer | jak1 <mike.wollmann@gmail.com> | 2021-08-02 00:12:08 +0200 |
commit | 6c6918bc386b9b085ebc070826294c755aff1f8a (patch) | |
tree | e27217ff431a64c69919efbd0b22e0af7f37024b /client | |
parent | 74a41caff6e7274c6926f5ae26b4180c920bb3dc (diff) | |
download | thepixelworld-6c6918bc386b9b085ebc070826294c755aff1f8a.tar.gz thepixelworld-6c6918bc386b9b085ebc070826294c755aff1f8a.tar.bz2 thepixelworld-6c6918bc386b9b085ebc070826294c755aff1f8a.tar.xz thepixelworld-6c6918bc386b9b085ebc070826294c755aff1f8a.zip |
removed const directions (seems to bug a bit (or there is maybe a better way doing that *shrugs*)
fixed some formating
Diffstat (limited to 'client')
-rw-r--r-- | client/consts.js | 9 | ||||
-rw-r--r-- | client/index.html | 7 |
2 files changed, 5 insertions, 11 deletions
diff --git a/client/consts.js b/client/consts.js index 242857d..b7df81d 100644 --- a/client/consts.js +++ b/client/consts.js @@ -3,14 +3,5 @@ const WIDTH = 500; const HEIGHT = 500; -// directions -const DIR_DOWN = 0; -const DIR_LEFT = 1; -const DIR_UP = 2; -const DIR_RIGHT = 4; - - - - // error codes const CONNECTION_LOST = 10001;
\ No newline at end of file diff --git a/client/index.html b/client/index.html index 797628f..eb88280 100644 --- a/client/index.html +++ b/client/index.html @@ -202,7 +202,7 @@ self.hp = initPack.hp; self.hpMax = initPack.hpMax; self.score = initPack.score; - self.dir = DIR_DOWN; + self.dir = initPack.dir; self.drawPlayer = function(){ var x = self.x - Player.list[selfId].x + WIDTH/2; @@ -244,6 +244,7 @@ self.x = initPack.x; self.y = initPack.y; self.map = initPack.map; + self.dir = initPack.dir; self.draw = function(){ var width = Img.bullet.width; @@ -308,6 +309,8 @@ b.x = pack.x; if(pack.y !== undefined) b.y = pack.y; + if(pack.dir !== undefined) + b.dir = pack.dir; } } }); @@ -353,7 +356,7 @@ tmxmap.drawLayer("ground",x,y); } - + var drawPlayerNames = function(){ for(var i in Player.list){ Player.list[i].drawPlayerName(); |