# Collect 450 coins

**URL:** https://forum.makecode.com/t/collect-450-coins/3913
**Category:** Arcade
**Tags:** game
**Created:** [October 16, 2020, 10:27am UTC](https://forum.makecode.com/t/collect-450-coins/3913 "2020-10-16T10:27:54Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![QuantumWolfy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/quantumwolfy/32/2002_2.png) [@QuantumWolfy](https://forum.makecode.com/u/QuantumWolfy)
#### Post date: [October 16, 2020, 10:27am UTC](https://forum.makecode.com/t/collect-450-coins/3913/1 "2020-10-16T10:27:54Z")

</div>

> **[Collect 450 coins](https://arcade.makecode.com/63482-15174-92477-12415)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![purna079](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purna079/32/4018_2.png) [@purna079](https://forum.makecode.com/u/purna079)
#### Post date: [October 16, 2020, 1:41pm UTC](https://forum.makecode.com/t/collect-450-coins/3913/2 "2020-10-16T13:41:01Z")

</div>

nice!

---

<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: [October 16, 2020, 1:43pm UTC](https://forum.makecode.com/t/collect-450-coins/3913/3 "2020-10-16T13:43:43Z")

</div>

Good job

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [October 18, 2020, 7:14am UTC](https://forum.makecode.com/t/collect-450-coins/3913/4 "2020-10-18T07:14:46Z")

</div>

Your animations are great.  
I would be nice if we could change the timer by a value, instead of only being able to set it. That way you could for instance add 1 second to the timer, each time the player gets a coin.

---

<div class="post-metadata">

### Author: ![QuantumWolfy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/quantumwolfy/32/2002_2.png) [@QuantumWolfy](https://forum.makecode.com/u/QuantumWolfy)
#### Post date: [October 21, 2020, 11:48am UTC](https://forum.makecode.com/t/collect-450-coins/3913/6 "2020-10-21T11:48:47Z")

</div>

Thanks!

---

<div class="post-metadata">

### Author: ![QuantumWolfy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/quantumwolfy/32/2002_2.png) [@QuantumWolfy](https://forum.makecode.com/u/QuantumWolfy)
#### Post date: [October 21, 2020, 12:00pm UTC](https://forum.makecode.com/t/collect-450-coins/3913/7 "2020-10-21T12:00:12Z")

</div>

but here is the thing though… I don’t know how to do that. do you know how? please tell me!

---

<div class="post-metadata">

### Author: ![QuantumWolfy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/quantumwolfy/32/2002_2.png) [@QuantumWolfy](https://forum.makecode.com/u/QuantumWolfy)
#### Post date: [October 21, 2020, 12:00pm UTC](https://forum.makecode.com/t/collect-450-coins/3913/8 "2020-10-21T12:00:54Z")

</div>

Thanks!

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [October 25, 2020, 11:42pm UTC](https://forum.makecode.com/t/collect-450-coins/3913/9 "2020-10-25T23:42:13Z")

</div>

> [@QuantumWolfy](#):
>
> but here is the thing though… I don’t know how to do that. do you know how? please tell me!

Hi there. I added these variables which define how many coins there are in the game, and how much time is remaining before the countdown ends. So basically, you start with 5 seconds, and get an extra 0.5 seconds each time you get a coin.

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

In the overlap event (when getting a coin), I added 4 lines of code which sets the remaining time in the game. In the ‘Game’ section, ‘time since start (ms)’ is the number of milliseconds since the game started (which is set to ‘timeSinceGettingLastCoin’ at the start). I then get the ‘timeDifference’, and set the remaining time to be what you start with, less the difference, plus the extra time for getting a coin. I set the countdown again and set the value of ‘timeSinceGettingLastCoin’ again.

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

You can adjust the variables in the game start to suit how much time to start with (secondsAtStart), and how much extra time you get for each coin (extraTimeGettingCoin, this is in seconds, a half second).

> **[Collect 450 coins (cosmos)](https://arcade.makecode.com/13506-21705-13108-13369)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [October 25, 2020, 11:44pm UTC](https://forum.makecode.com/t/collect-450-coins/3913/10 "2020-10-25T23:44:18Z")

</div>

> [@QuantumWolfy](#):
>
> Thanks!

You’re welcome. 👍
