# Simple shooter with tanks

**URL:** <https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971>\
**Category:** Demos and projects\
**Created:** [November 23, 2022, 9:28pm UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971 "2022-11-23T21:28:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ARAMONIS](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aramonis/32/27804_2.png) [@ARAMONIS](https://forum.babylonjs.com/u/ARAMONIS)\
**Post date:** [November 23, 2022, 9:28pm UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/1 "2022-11-23T21:28:27Z")

</div>

[fieldsofexplode.netlify.app]  
([https://fieldsofexplode.netlify.app](https://fieldsofexplode.netlify.app))

Controls on pc - w,a,s,d and arrows. Controls on mobile - swipes

 ![Screenshot_20221111_194328](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/a/da4d611fc3470fa3b10d85f0441e685459606796.jpeg)

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [November 24, 2022, 9:14am UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/2 "2022-11-24T09:14:47Z")

</div>

Hi @ARAMONIS and welcome to the forum!  
I tried the app but I can’t move. wasd or arrow keys didn’t change anything.

---

<div class="post-metadata">

**Author:** ![ARAMONIS](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aramonis/32/27804_2.png) [@ARAMONIS](https://forum.babylonjs.com/u/ARAMONIS)\
**Post date:** [November 25, 2022, 3:42pm UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/3 "2022-11-25T15:42:06Z")

</div>

Thanks for the feedback. Strangely, everything worked on my computer. I’ll try to fix it

---

<div class="post-metadata">

**Author:** ![ARAMONIS](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aramonis/32/27804_2.png) [@ARAMONIS](https://forum.babylonjs.com/u/ARAMONIS)\
**Post date:** [November 30, 2022, 2:56am UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/4 "2022-11-30T02:56:28Z")

</div>

I think i fixed it

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [November 30, 2022, 11:24am UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/5 "2022-11-30T11:24:25Z")

</div>

Is it still the same link? Because if so, then I’m still unable to move. Of course, my poor knowledge of your language doesn’t help with the understanding of the controls 😉  
Did you enter the keyCode or just the character?  
Try this:

```auto
scene.onKeyboardObservable.add((kbInfo) => {
  switch (kbInfo.type) {
  //on key press
  case BABYLON.KeyboardEventTypes.KEYDOWN:
      switch (kbInfo.event.key) {
        case "w":
        case "W":
        case 87:
        console.log ("forward");
        break
        case "s":
        case "S":
        case 83:
        console.log ("backward");
        break
        case 65:
        case "a":
        case "A":
        console.log ("left");
        break  
        case 68:
        case "d":
        case "D":
        console.log ("right");
        break 
      }
    break;
  }
});

```

---

<div class="post-metadata">

**Author:** ![ARAMONIS](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aramonis/32/27804_2.png) [@ARAMONIS](https://forum.babylonjs.com/u/ARAMONIS)\
**Post date:** [December 2, 2022, 2:30am UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/6 "2022-12-02T02:30:10Z")

</div>

The editor did not save the changes 😅 Updated again.  
I’ve always used “event.keyCode”, but it turned out that this is an outdated method.

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [December 2, 2022, 11:31am UTC](https://forum.babylonjs.com/t/simple-shooter-with-tanks/35971/7 "2022-12-02T11:31:44Z")

</div>

Still the same link? Now the GUI is gone and I cannot start the game.
