# Some Noob questions

**URL:** https://forum.makecode.com/t/some-noob-questions/944
**Category:** Arcade
**Created:** [December 24, 2019, 6:28am UTC](https://forum.makecode.com/t/some-noob-questions/944 "2019-12-24T06:28:46Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Momoro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/momoro/32/520_2.png) [@Momoro](https://forum.makecode.com/u/Momoro)
#### Post date: [December 24, 2019, 6:28am UTC](https://forum.makecode.com/t/some-noob-questions/944/1 "2019-12-24T06:28:46Z")

</div>

Hi!

I have a number of questions, that I hope you can answer 🙂

• I need to load text from the README.md, or any file in the MakeCode Arcade’s Explorer, but I can’t seem to find the right feature.(And I don’t know how to use `settings.readString(key: string)`)

• I am producing a sort of RPG game, kind of like Pokemon, and I need sprite collision. -Meaning, when the player `overlaps` another sprite, it will just keep the player in the same position until the player walks away, or into another direction.

• I need to send data to another player when a connection is successfully established; e.g. if the players decide to trade $5 and x1 Water Bottle, then it should send over the items, and remove the correct items / cash from the players’ inventory.

Any help is highly, highly appreciated 😄

---

<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 24, 2019, 8:26am UTC](https://forum.makecode.com/t/some-noob-questions/944/2 "2019-12-24T08:26:11Z")

</div>

- `settings.readString` stores the string in the devices flash memory; this will let you save the data to the device. here’s a quick example of using it to store a message for future players (like you would save data, so that you could save the data as the player progresses, and try to read it whenever they reset the device): [https://makecode.com/\_3uF6WxXu9VX7](https://makecode.com/_3uF6WxXu9VX7)

![2019-12-24 00.09.39](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/121f30c60b9ddf60ceda1af8260db440e6b4c958.gif)

- You could handle it with overlaps, it might be a bit tricky though - you would probably end up wanting to figure out which direction the player is coming from (based off their velocities), and reset the position to be opposite that direction when they hit one of the sprites - e.g. if the player is moving right and they overlap an enemy, set the player’s `.right` position to the enemies `.left` position: [https://makecode.com/\_15bRj9cL5crA](https://makecode.com/_15bRj9cL5crA)

other potential approaches:

- make the other ‘sprites’ walls if they aren’t moving, and let the physics take of them / handle the collections with wall collision handlers.
- the [tileworld](https://forum.makecode.com/t/arcade-tileworld-extension-and-demo-boulder-game/659) extension handles things like this nicely by aligning sprites to the grid, but I’m not sure if the current state is fully stable / if there is any documentation (@tballmsft). Also, the extension linked in that post is a bit older; now located [here](https://github.com/microsoft/pxt-tileworld)

(re: hardware multiplayer, I haven’t personally interacted used it / made any multiplayer games on hardware yet, and there will likely be more iterations before that part of the codebase is fully stable)

---

<div class="post-metadata">

### Author: ![Momoro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/momoro/32/520_2.png) [@Momoro](https://forum.makecode.com/u/Momoro)
#### Post date: [December 28, 2019, 6:48am UTC](https://forum.makecode.com/t/some-noob-questions/944/3 "2019-12-28T06:48:29Z")

</div>

Joey, this is extremely helpful. But I have a question… Can I save multiple strings, without them overlapping each other?

I want to save name and score, not only one string.(Would be pointless 😅) Any ideas on this? Thanks 😁

---

<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 28, 2019, 8:02am UTC](https://forum.makecode.com/t/some-noob-questions/944/4 "2019-12-28T08:02:54Z")

</div>

Yes - the ‘key’ is like a file name in this case, so if you need to store a name and a score you could use two keys - “mySavedName” and “mySavedScore” - and then it will store the two values separately, and you can read them using those keys. (Going of the example above, just make unique names for each thing you need to save / read, and use each of them like I did `myKey`)

Just a note, if you store too much at once and it runs out of memory, the current behavior is that you will get a crash with a 920 error, and the data will be wiped on the next load.

---

<div class="post-metadata">

### Author: ![Momoro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/momoro/32/520_2.png) [@Momoro](https://forum.makecode.com/u/Momoro)
#### Post date: [December 28, 2019, 11:47pm UTC](https://forum.makecode.com/t/some-noob-questions/944/5 "2019-12-28T23:47:26Z")

</div>

🙂 Joey, you are AMAZING! Thanks! 😁

---

<div class="post-metadata">

### Author: ![Blobiy](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Blobiy](https://forum.makecode.com/u/Blobiy)
#### Post date: [March 30, 2020, 3:16pm UTC](https://forum.makecode.com/t/some-noob-questions/944/6 "2020-03-30T15:16:18Z")

</div>

wait, you can save info on the arcade, like turn it off and back on and have the same game, like a save, or am i miss reading this?

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [March 30, 2020, 3:42pm UTC](https://forum.makecode.com/t/some-noob-questions/944/7 "2020-03-30T15:42:34Z")

</div>

Yes, use the “settings” extension. Click Advanced -\> Extensions -\> settings.

---

<div class="post-metadata">

### Author: ![Blobiy](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Blobiy](https://forum.makecode.com/u/Blobiy)
#### Post date: [April 2, 2020, 2:38pm UTC](https://forum.makecode.com/t/some-noob-questions/944/8 "2020-04-02T14:38:47Z")

</div>

its not there

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [April 2, 2020, 3:51pm UTC](https://forum.makecode.com/t/some-noob-questions/944/9 "2020-04-02T15:51:41Z")

</div>

@peli, do we have a blocks extension for the settings? I don’t see it either. The APIs are available in JavaScript without any additional packages

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 2, 2020, 4:32pm UTC](https://forum.makecode.com/t/some-noob-questions/944/10 "2020-04-02T16:32:16Z")

</div>

Oh snap we probably don’t. We also don’t have blocks to store data into the sprite data object which is very annoying. We need an create an extension for this.

---

<div class="post-metadata">

### Author: ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)
#### Post date: [April 2, 2020, 6:53pm UTC](https://forum.makecode.com/t/some-noob-questions/944/11 "2020-04-02T18:53:48Z")

</div>

> [@peli](#):
>
> We also don’t have blocks to store data into the sprite data object which is very annoying.

Oh! Yes! My son was working on his own “Galga” and was making different kinds of enemies. He wanted the bigger ones to take two hits, but I didn’t have any good suggestions for how to track their health.

He decided to just spawn a maximum of one per screen, which worked… but it’d be excellent to have support for sprite-scoped data.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 2, 2020, 7:19pm UTC](https://forum.makecode.com/t/some-noob-questions/944/12 "2020-04-02T19:19:42Z")

</div>

I’ll spin an extension for the sprite data.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 3, 2020, 3:00am UTC](https://forum.makecode.com/t/some-noob-questions/944/13 "2020-04-03T03:00:13Z")

</div>

Here is an extension with blocks to store data in sprites: [https://github.com/pelikhan/sprite-data](https://github.com/pelikhan/sprite-data)

---

<div class="post-metadata">

### Author: ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)
#### Post date: [April 3, 2020, 4:39pm UTC](https://forum.makecode.com/t/some-noob-questions/944/14 "2020-04-03T16:39:57Z")

</div>

Thanks! Looks really useful. Looks like there’s one small problem with the comment above `readDataAsString`. I created an issue: [https://github.com/pelikhan/sprite-data/issues/1](https://github.com/pelikhan/sprite-data/issues/1)

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [April 3, 2020, 6:26pm UTC](https://forum.makecode.com/t/some-noob-questions/944/15 "2020-04-03T18:26:58Z")

</div>

@Blobiy I just created a settings extension for saving game data. Check it out [here](https://forum.makecode.com/t/settings-extension/1594)
