From 33ab4a46245453116dc2e8a32c6d95c9f2fec00b Mon Sep 17 00:00:00 2001 From: Arne van Iterson Date: Mon, 2 Mar 2020 17:13:27 +0100 Subject: [PATCH] Added player entity and added some gfx for testing --- res/dungeon_tiles.png | Bin 0 -> 14224 bytes res/main.css | 17 +++++++++ res/player.png | Bin 0 -> 1394 bytes src/entities/player.js | 78 +++++++++++++++++++++++++++++++++++++++++ src/index.js | 22 +++++++++--- 5 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 res/dungeon_tiles.png create mode 100644 res/main.css create mode 100644 res/player.png create mode 100644 src/entities/player.js diff --git a/res/dungeon_tiles.png b/res/dungeon_tiles.png new file mode 100644 index 0000000000000000000000000000000000000000..91b45700cc290a79e24df341e92cd6c57370a052 GIT binary patch literal 14224 zcmeHtbx>PT7iVy{Qrz94KnU&@ic2XjMT5JySaB&KxJ%ID1Sn9Tl;R#JTA*lwV#O(x zZu)(@GyB*6y)(OS=1r1&kKFS+_uV6T33@u}MEJD$004kU1FT{I0H6U;Hy9TKHFD5* zPKElwbW+q-1OS>-!|wHAsNc+XU;}LcAdUn8NJia%P)v~u0Kn^D6h{&OAhQbq&`kKs z!~_BW_(Bk6WjzgLWoA7ePe+KG0{{RXF3buvGFqgJo9+n=DV=z;Bd#WuYHPn5)IX}PO zuJb%@z3IF^>X|m90;E?7WoKh+qNR8G{N@i#2nge zen)B!$6jtlvhf5-TPTs-J%3Ai&T@@Rd;FkeRjc9hs}qV}?OH7AU*a3%2}C;!_{lb& zG^-^(%jDY<-&!&v7R3NO)o`QoGD%WoF&p=F83onfb#UgRAg%fsjAuzY->jV zfubURYW4p5UwA(MwyGLJbKB`eTK_lcxbXo=3$U3;aB00r5@^7Wm=XYttlhtwlK@1( zt34SO`?^T9WrPyY6}wWJy^W2t$g&4So={zq{Lzi;D{bs`VwXF4cRph&`Af?-F+#9` zj!%F?d!)(OG|i&EWunSN4&h6YCGO~V;eVAuyJ+hEs42zX(7e4@LJCMCr)#-Ida z)RiaKK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D~5ek|yE`3kF8uz^{t(jAvweBNb%mEg{UrGHEUN`y<>rwisC~!nV!zZoM z?S1GNIQ*j=`IaB5&l@@hfb>QS!&(fi)w6V|o&MZEe?9j6-ELu}9gAgCD0XUbzgO?9 zti!}dy01^>7lJw6&peFEpFuQU`03KzrDT4(^^QWdgNvX2JN0uBz$BDbvO&M^!XT9_gD#fbaA>7lUjUMc;=WqrHV)yeA4CmY zWtF4WS=U47fJATmuV7~G^JzHE&r>xrq#r7}T?LlMLr?JR{;YAof`@)K2^UYKMg>4n j51neVpDy`E?;rUUigZ;nvKX#^Z<}hU>Zmj**+l&hFl;`* literal 0 HcmV?d00001 diff --git a/res/main.css b/res/main.css new file mode 100644 index 0000000..9a218f0 --- /dev/null +++ b/res/main.css @@ -0,0 +1,17 @@ +body { + background-color: rgba(42, 42, 46, 1); + text-align: center; + + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} +#board { + position: relative; + background-color: #111; + width: max-content; + height: auto; + margin: auto; + border: 5px solid whitesmoke; +} diff --git a/res/player.png b/res/player.png new file mode 100644 index 0000000000000000000000000000000000000000..92ed8d366152438e985faa022b986d62d7dc02ea GIT binary patch literal 1394 zcmV-&1&#WNP)dOlz_zieEoPDNF6$Uq(F%A;pXW$ zbbNWvOM{jlDWGHLhL;8%KT=?8>=qh_5l5gc%oJ!i#_76|XZy!Qpp5;KhOxMbhI2fwgd{^~(tnLM{!CVC#lf4%|d`_`oO!g6W{^&k+AlzvA?H7yw z!emGgHGfOr4kAI+{1Q}yYj_sl4kdpK-h%7rYr0m51hMmHE32Cur4v9Wh@F46oo8P= zVuG0Y2irli z8=GPYDm6Bt`D4bi7=N*`EN1J-O`yh>l8awzY(n$LjAgm_F1D0dg}rPYsRR`pn;P)P zjAf|;6kiS1wvN~Yylfq*1l1m=qxmgks=zKCp42|t!`88upmXJ4T=PKLQq~f5&irs& z2in-wf*)lpTU2@NIj{IFd`F0$Gs0N5+s5uYf(jwUkQ%i7Eqpa-YYHvDZ9aQiI$CH@ z^RES#*N_RS(V*tv>Ur@@kf#Paf6{i5vR~9LC*ZBY&cAuB1rb25=TM@-&c7Pm+At6k zsL^2Op9QyTEm$i?ZPOf~!OlMg*VYPaI;!%#fHm0pXBWzJv)NiNf&;+gSB3};cK%HQ zHJ_js8tnX&fVEwS^}_RtC`yB!f6-Y&{KONfLCtR$HPSv9&reTmO&<@9J@{QUavmGc z3AiltvIBo=X&g6=Rt3;H!A-zc0L|=P0Bu6j77}CuJa<7Y`1N0{tA-7(Ef}5?uq&8o zcL4*xU6I9A!+yh~x=APvcK+GPhO6DeoX$&JluiqNI|tVlQ@mSwu}_cH@=g>h|3Yj4 zZY_2djQoAud+WZSoiw^HXh)4$+pTt$k(L_N{BrZNl+D5`K`0Gs{w;x9B&bw_oqy4A z&Us%vY#rVj?EJGcJoMe@5E|_K(dAfBH^D(@u=7s>cIlOr52mJRj?!S~pRI{wy)JsG z7LOH25E|_KWANZ { + element.y = this.direction; + }); + + // Animate + if (this.curTime > rate) { + this.frame = frames[this.curFrame++ % frames.length]; + this.curTime -= rate; + } + } +} + +module.exports = Player; \ No newline at end of file diff --git a/src/index.js b/src/index.js index dd3b217..9bf382d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,19 @@ -var asdf = require("asdf-games"); -const { Game, Container, CanvasRenderer, math, SpriteSheetXML, KeyControls, MouseControls, Text, Texture, Sprite, TileMapXML, TileSprite, TileSpriteXML } = asdf; +var asdf = require('asdf-games'); +const { Game, Container, math, KeyControls, MouseControls, Text, Texture, TileMap, Sprite, TileSprite } = asdf; -const game = new Game(720, 480, false); -const { scene, w, h } = game; \ No newline at end of file +const game = new Game(640, 320, true); +const { scene, w, h } = game; + +const mouseAim = new MouseControls(); +const keys = new KeyControls(); + +var Player = require("./src/entities/player.js") +var player = new Player(keys); + +scene.add(player); + +game.run((dt ,t) => { + if (mouseAim.isDown) { + console.log('cliccccccccccc'); + } +}); \ No newline at end of file