# Plinko

**URL:** <https://forum.makecode.com/t/plinko/2707>\
**Category:** Arcade\
**Tags:** game\
**Created:** [July 8, 2020, 10:04pm UTC](https://forum.makecode.com/t/plinko/2707 "2020-07-08T22:04:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [July 8, 2020, 10:04pm UTC](https://forum.makecode.com/t/plinko/2707/1 "2020-07-08T22:04:27Z")

</div>

> **[PLINKO](https://arcade.makecode.com/70146-65621-23617-58657)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I wanna see opinions and see what changes I could make.

@richard Thx for helping me!

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 8, 2020, 10:19pm UTC](https://forum.makecode.com/t/plinko/2707/2 "2020-07-08T22:19:34Z")

</div>

I think you should be able to spam the A button instead of having to deal with the pop up of 25 to roll again.

Otherwise, great game!

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [July 8, 2020, 10:48pm UTC](https://forum.makecode.com/t/plinko/2707/3 "2020-07-08T22:48:04Z")

</div>

I don’t know how to do that. When I tried it, the coin froze on top of the pole and it wouldn’t work for some reason. Is there any code there is to spam?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 9, 2020, 1:53am UTC](https://forum.makecode.com/t/plinko/2707/4 "2020-07-09T01:53:38Z")

</div>

> [@UnsignedArduino](#):
>
> I think you should be able to spam the A button…

Sorry if I confused you, but I meant that I should be able to press the A button really fast that would allow more than 1 coin on screen at a time.

---

<div class="post-metadata">

**Author:** ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)\
**Post date:** [July 9, 2020, 6:24am UTC](https://forum.makecode.com/t/plinko/2707/5 "2020-07-09T06:24:21Z")

</div>

Great idea, kept trying for 5 minutes and finally got a 100 slot 😁 😁 😁

While trying found a bug that if A is pressed while the first coin is still in the air, game will be over. (Hey, I still got hope 🤣)

![Screen-Recording-2020-07-09-at-2](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/0beadfde94f80452e6a5bb3df411f83a99a6209a.gif)

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [July 9, 2020, 12:00pm UTC](https://forum.makecode.com/t/plinko/2707/6 "2020-07-09T12:00:49Z")

</div>

Thats because if you have lower than 25 points, you lose.

I made you automatically lose because you had lower than 25 points and you wanted another ball

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [July 9, 2020, 12:01pm UTC](https://forum.makecode.com/t/plinko/2707/7 "2020-07-09T12:01:09Z")

</div>

you need 25 points for another ball to come down

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [July 9, 2020, 12:07pm UTC](https://forum.makecode.com/t/plinko/2707/9 "2020-07-09T12:07:27Z")

</div>

> **[PLINKO](https://arcade.makecode.com/38070-85468-67406-31533)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The coin on the top right is frozen and the other coin is not.  
The other coin on the bottom is still bouncing to the hundred or fifty.  
Is there any code I could use to fix this bug?

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [July 9, 2020, 12:22pm UTC](https://forum.makecode.com/t/plinko/2707/10 "2020-07-09T12:22:50Z")

</div>

This is Plinko (lazy edition)

> **[PLINKO](https://arcade.makecode.com/51765-01782-71941-06009)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)\
**Post date:** [July 10, 2020, 2:54am UTC](https://forum.makecode.com/t/plinko/2707/11 "2020-07-10T02:54:34Z")

</div>

Oh, is it that when there are not enough points for another coin, the game’s over? That’s reasonable.  
But from the player’s view, there’s still some hope(coin) in the air, what if it falls into a 100 😁

It seems a little bit more reasonable that when there are not enough points for another coin AND no running coins in the air, the game’s over.

Using arrays instructions can get the current number of running coins in the game, as the following code snippet shows the number of coins when B is pressed.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2101df1e6124c297f73db28fd7a5f9da8b8654e6.png)

And if one more step forward, to make the game over automatically instead of triggered by player pressing A, the decision making logic can go to:  
a) an event that hints the game might be over  
b) a periodically check

Again, just some thoughts from a player’s view. 🙂

---

<div class="post-metadata">

**Author:** ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)\
**Post date:** [July 10, 2020, 3:10am UTC](https://forum.makecode.com/t/plinko/2707/12 "2020-07-10T03:10:17Z")

</div>

Hmmm, looks like the bug is somewhat related to multiple coins. During testing, I didn’t reproduce it with one running coin while reproduced several times with 2 and more coins.

Maybe have a look into the bouncing code?

Also, `mySprite` is a variable that can store ONLY ONE item, imaging it like a bowl that can only hold one item, setting it multiple times results in having the LAST item in the bowl.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d23ecbf6cc6da3613315862495cdde9657b8b737.png)

While `sprite` in event callback is an event variable holding the exact sprite in the event, like `sprite` in the following code is holding the sprite that is hitting the wall.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8937dd14a5fdd428d45338f3cadf3c1a8282043d.png)
