# Game Made in p5.js

**URL:** <https://discourse.processing.org/t/game-made-in-p5-js/5133>\
**Category:** Gallery\
**Created:** [November 2, 2018, 8:38pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133 "2018-11-02T20:38:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 2, 2018, 8:38pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/1 "2018-11-02T20:38:32Z")

</div>

A couple years ago I made this game in processing. I recently converted it to p5.js, and I wanted to share it.

[http://pizza-penguin.quillbert.tk](http://pizza-penguin.quillbert.tk)

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 2, 2018, 10:30pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/2 "2018-11-02T22:30:14Z")

</div>

Hi Quillbert1,

the controls are not working for me. The arrow keys either have no effect or behave super weirdly…

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 3, 2018, 1:00am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/3 "2018-11-03T01:00:57Z")

</div>

It should just be the up and down arrow keys. Do those work?

---

<div class="post-metadata">

**Author:** ![r4nd0m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/r4nd0m/32/9477_2.png) [@r4nd0m](https://discourse.processing.org/u/r4nd0m)\
**Post date:** [November 3, 2018, 7:45pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/4 "2018-11-03T19:45:14Z")

</div>

Dude it’s so dope! And the audio lol

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 3, 2018, 9:55pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/5 "2018-11-03T21:55:26Z")

</div>

Well yeah, I tried up and down arrow key and it is not working. To be more precise it works in a random way…

I’m running it on Chrome: Version 70.0.3538.77 (64 bits)

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 4, 2018, 3:07am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/6 "2018-11-04T03:07:54Z")

</div>

That’s weird. It works fine for me. You can see the code [here](https://github.com/Quillbert/Pizza_Penguin) if that helps, but I can’t think of what would be wrong.

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 4, 2018, 4:33am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/7 "2018-11-04T04:33:48Z")

</div>

Thanks! I made the audio in earsketch a couple of years ago, and I decided it would be good for a game.

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 4, 2018, 5:36am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/8 "2018-11-04T05:36:41Z")

</div>

@jb4x I think i found the problem, the canvas was too tall for chrome, so it was scrolling when the arrow keys were used. I made the canvas shorter, so that should no longer be a problem.

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 4, 2018, 9:19am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/9 "2018-11-04T09:19:31Z")

</div>

I still can’t manage to move the penguin up and down 😕

---

<div class="post-metadata">

**Author:** ![Eeyorelife](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@Eeyorelife](https://discourse.processing.org/u/Eeyorelife)\
**Post date:** [November 4, 2018, 6:50pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/10 "2018-11-04T18:50:18Z")

</div>

This is super cool, lol! But maybe a bit easy? I’m on the phone so can’t control it, but managed to stay alive for quite a while.  
But otherwise very fun

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 4, 2018, 9:41pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/11 "2018-11-04T21:41:18Z")

</div>

That is really weird. Are you using a mac? The isKeyDown function might work differently on a mac, that is the only other thing I can think of.

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 4, 2018, 9:42pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/12 "2018-11-04T21:42:22Z")

</div>

@Eeyorelife The game gets harder the better you do, so if you don’t eat the pizza, the sharks will stay away.

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 5, 2018, 6:49am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/13 "2018-11-05T06:49:42Z")

</div>

Not even that, I’m using W10…

It seems that I’m the only one having that problem, I’m probably doing something wrong!

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 5, 2018, 7:04am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/14 "2018-11-05T07:04:53Z")

</div>

huh… If you click the home link at the top, there is a link to brick breaker. Do the left and right arrow keys work on that?

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 5, 2018, 7:10am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/15 "2018-11-05T07:10:36Z")

</div>

Nope…

And I’m getting the exact same behavior: the first time I press an arrow key, it goes to that direction. But then I have no control over it anymore. So it feels like it is working only once…

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 5, 2018, 7:15am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/16 "2018-11-05T07:15:08Z")

</div>

That is really weird. Sorry, but I don’t know what could be wrong.

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [November 5, 2018, 7:19am UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/17 "2018-11-05T07:19:10Z")

</div>

@jb4x if you press the left arrow on this sketch, does the background turn black? And when you release it, does it go back to white?

[https://editor.p5js.org/Quillbert/sketches/S1HiRDT3m](https://editor.p5js.org/Quillbert/sketches/S1HiRDT3m)

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 5, 2018, 4:54pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/18 "2018-11-05T16:54:35Z")

</div>

This is working perfectly!

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [November 5, 2018, 4:58pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/19 "2018-11-05T16:58:56Z")

</div>

The controls work when I am holding the shift key.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [November 5, 2018, 5:08pm UTC](https://discourse.processing.org/t/game-made-in-p5-js/5133/20 "2018-11-05T17:08:52Z")

</div>

Worked fine for me. I only scored 19 but what the heck.

I liked the parallax effect on the water/waves and the music.

My only criticism would be the collision detection it seems a bit ‘coarse’

Good fun 😆

[Next page](https://discourse.processing.org/t/game-made-in-p5-js/5133.md?page=2)
