KayacChang Posted October 14, 2019 Share Posted October 14, 2019 Hi everyone, I just create a simple show case for PIXI.JS. A top-down Tank game with: 1. Physic engine integration with matter-js. 2. ViewPort for 2D camara. 3. Custom Tile map and grid system. 4. Dynamic generate new area . 5. Keyboard Control. 6. GUI Interface. Example: https://kayacchang.github.io/Tank/dist/ Source Code: https://github.com/KayacChang/Tank ivan.popelyshev and Jammy 2 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 14, 2019 Share Posted October 14, 2019 you should switch from just "keydown" to setting FLAG to true on keydown and setting it to false when its up. In update, if flag is true - move the tank. When I press "W" tank moves a bit, then autorepeat starts, like in old NES tetris. Im not a hyper-tapper KayacChang 1 Quote Link to comment Share on other sites More sharing options...
KayacChang Posted October 17, 2019 Author Share Posted October 17, 2019 Hello @ivan.popelyshev , Could you told me which OS and Browser you use? The keypress holding functionality work fine in my system, using Mac OS and Chrome. And Yes, I will change my movement logic, this is a great idea to both fix the problem and improve performance. Thank you very much. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 17, 2019 Share Posted October 17, 2019 That's an old gamedev trick, you will encounter it everywhere First you press the key, keydown is fired ONE time, then after 9 frames it start repeats. Try that with your keyboard here - hold A and look at how letters appear, there's pause between first and second. Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted October 18, 2019 Share Posted October 18, 2019 Add multiplayer to your game. This article are awesome: Real Time Multiplayer in HTML5. The article explains how to use some methods for network latency compensation. I deployed the example from the article on Heroku. You can run it in two browser windows: https://battle-world.herokuapp.com/?debug (It is free hosting and sometimes you need to way a few seconds when server is waking up) The article has links on another good articles about network latency compensation methods. I am rewriting the code example from the article to TypeScript. Quote Link to comment Share on other sites More sharing options...
Jammy Posted October 20, 2019 Share Posted October 20, 2019 On 10/14/2019 at 6:20 AM, KayacChang said: 5. Keyboard Control. Great little demo! I would suggest definitely making the keyboard changes as suggested by Ivan, it's a bit iffy for me. Windows 10/Chrome. I even tried to bug it out by messing around with pushing tanks into objects and everything seemed pretty solid! No issues there. Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted October 20, 2019 Share Posted October 20, 2019 (edited) My dream is to make the Battle City game with multiplayer. I will take textures, tiles and some rules from the original games but I need to create right rules for a few teams and coop mode. I think it will be a good practice. Edited October 20, 2019 by 8Observer8 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.