# Game Issues and idk what to do

**URL:** <https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592>\
**Category:** Arcade\
**Created:** [April 3, 2020, 5:32pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592 "2020-04-03T17:32:17Z")\
**Posts on this page:** 7\
**Page:** 1

<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 3, 2020, 5:32pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/1 "2020-04-03T17:32:17Z")

</div>

Hello Joey and Peli, and all of you out here.  
i have a few questions about my game, i was hoping for some help  
Although I do have so more issues, so…

1. I have the same code for all of my “opponents”  
the issue is that the fire dude is staying in his dead image, but the other two are not.  
i am pretty sure it is a dumb mistake but…

2. I am trying to get your character to evolve. I initially tried to just swap the character with the evolved form in the array, the issue is that  
a) it does not work  
b) it breaks the health bar, and by break I mean it just disappears  
I am still working on it, but it seems to be a wall, so I have started to work just on the “stats” for the main  
mon and the opponent mon.

3. Do any of you know if there is a way to made vars, like, I want a Attack, Defense, Health, Speed, and Mana value for each of my Monsters, do i just write those out. Because I can see how this would be a pain for when this project gets big, “catching” mons would make this a BIG pain because i would have t make like 40 gazillion vars. and its hard because i can’t just type it in, i have to mindlessly scroll.

4. Lastly, i was wondering, i know how in java and other things, you can call whole scripts, like, the waking and moving part is one script, and then the battling is a script. Is this what i am thinking, and is there a way to do it in blocks?

link to game:  
[PocketPets](https://makecode.com/_CxW2p8bmi59Y)

thanks so much btw.  
-Blobiy

---

<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:** [April 3, 2020, 6:01pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/2 "2020-04-03T18:01:18Z")

</div>

> [@Blobiy](#):
>
> Do any of you know if there is a way to made vars, like, I want a Attack, Defense, Health, Speed, and Mana value for each of my Monsters, do i just write those out. Because I can see how this would be a pain for when this project gets big, “catching” mons would make this a BIG pain because i would have t make like 40 gazillion vars. and its hard because i can’t just type it in, i have to mindlessly scroll.

> [@Sprite-data extension](https://forum.makecode.com/t/sprite-data-extension/1590):
>
> The arcade-sprite-data extension ([https://github.com/microsoft/arcade-sprite-data](https://github.com/microsoft/arcade-sprite-data)) adds blocks to store/read numbers and strings in sprites. [Read the manual](https://microsoft.github.io/arcade-sprite-data/README) To use it, click Advanced click Extensions Search [https://github.com/microsoft/arcade-sprite-data](https://github.com/microsoft/arcade-sprite-data) Add to your project

---

<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:** [April 3, 2020, 6:04pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/3 "2020-04-03T18:04:02Z")

</div>

> [@Blobiy](#):
>
> Lastly, i was wondering, i know how in java and other things, you can call whole scripts, like, the waking and moving part is one script, and then the battling is a script. Is this what i am thinking, and is there a way to do it in blocks?

In the advanced section of the block menu, you can define and call functions.

> **[Activity: Functions Intro](https://arcade.makecode.com/courses/csintro2/functions/intro)**
>
> Functions are a way to group sections of code to be run together. They are regularly used when writing code both to increase the readability of code, and to allow for reuse of common actions.

---

<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:13pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/4 "2020-04-03T18:13:56Z")

</div>

So one idea for the character stats is to create a function that sets all of the properties on a sprite. For example, try this sample code:

> **[stats-example](https://arcade.makecode.com/23739-62973-07296-62101)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

This uses peli’s sprite data extension

---

<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 3, 2020, 6:31pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/5 "2020-04-03T18:31:28Z")

</div>

yeah, i already complaind about how fast he put that up…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:** [April 3, 2020, 6:35pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/7 "2020-04-03T18:35:32Z")

</div>

also, thanks but I was wondering if i could get whole things, so i did not have to have 400000000000 blocks on one page, because enow i am already using functions, but i was wondering if I could have a folder almost, and it had my code for battling and then a whole other page for the moving, and another for the intro. - 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:** [April 3, 2020, 6:37pm UTC](https://forum.makecode.com/t/game-issues-and-idk-what-to-do/1592/8 "2020-04-03T18:37:53Z")

</div>

thanks the both of you!!
