# How do I control Player 2 in the simulator?

**URL:** https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923
**Category:** Arcade
**Created:** [December 19, 2019, 4:00pm UTC](https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923 "2019-12-19T16:00:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![haroongames100](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@haroongames100](https://forum.makecode.com/u/haroongames100)
#### Post date: [December 19, 2019, 4:00pm UTC](https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923/1 "2019-12-19T16:00:21Z")

</div>

Hi, I’m making a ping pong game, and I want to be able to control Player 2 to make sure it works. Only thing though, I can only control Player 1. Is there a way I can control Player 2? Thanks!

Here is my code:

```auto
controller.up.onEvent(ControllerButtonEvent.Pressed, function () {
    paddle1.y += -7
})
controller.down.onEvent(ControllerButtonEvent.Pressed, function () {
    paddle1.y += 7
})
controller.player2.onButtonEvent(ControllerButton.Up, ControllerButtonEvent.Pressed, function () {
    paddle2.y += -7
})
controller.player2.onButtonEvent(ControllerButton.Down, ControllerButtonEvent.Pressed, function () {
    paddle2.y += 7
})
let paddle2: Sprite = null
let paddle1: Sprite = null
// Paddle hit noise
music.pewPew.playUntilDone()
// Get point sound
music.baDing.playUntilDone()
// game start sound
music.powerUp.playUntilDone()
info.player1.setScore(0)
info.player2.setScore(0)
paddle1 = sprites.create(img..., SpriteKind.Player)
paddle1.setPosition(24, 61)
paddle2 = sprites.create(img..., SpriteKind.Player)
paddle2.setPosition(136, 61)
let ball = sprites.create(img..., SpriteKind.Projectile)
})

```

---

<div class="post-metadata">

### Author: ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)
#### Post date: [December 19, 2019, 5:57pm UTC](https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923/2 "2019-12-19T17:57:08Z")

</div>

The IJKL keys should work for the second player like the WASD keys work for the first player (if you happen to have two game controllers, like xbox controllers, connecting them should work too - though some buttons might be mapped weirdly depending on the controllers)

---

<div class="post-metadata">

### Author: ![haroongames100](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@haroongames100](https://forum.makecode.com/u/haroongames100)
#### Post date: [December 19, 2019, 7:07pm UTC](https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923/3 "2019-12-19T19:07:05Z")

</div>

@jwunderl Thanks!

---

<div class="post-metadata">

### Author: ![Purp13](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purp13/32/3765_2.png) [@Purp13](https://forum.makecode.com/u/Purp13)
#### Post date: [March 19, 2021, 7:27am UTC](https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923/4 "2021-03-19T07:27:00Z")

</div>

How do you control player 2 in simulation on ipad

---

<div class="post-metadata">

### Author: ![Purp13](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purp13/32/3765_2.png) [@Purp13](https://forum.makecode.com/u/Purp13)
#### Post date: [March 25, 2021, 4:47pm UTC](https://forum.makecode.com/t/how-do-i-control-player-2-in-the-simulator/923/5 "2021-03-25T16:47:23Z")

</div>

If your on mobile or pc you can use ps4 controllers this makes helps a lot
