# How to make AI

**URL:** https://forum.makecode.com/t/how-to-make-ai/27776
**Category:** Arcade
**Created:** [March 16, 2024, 12:01am UTC](https://forum.makecode.com/t/how-to-make-ai/27776 "2024-03-16T00:01:38Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![GraysonB0](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@GraysonB0](https://forum.makecode.com/u/GraysonB0)
#### Post date: [March 16, 2024, 12:01am UTC](https://forum.makecode.com/t/how-to-make-ai/27776/1 "2024-03-16T00:01:38Z")

</div>

I don’t know how to make AI. But I want to in Microsoft MakeCode.

---

<div class="post-metadata">

### Author: ![Bifrosty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bifrosty/32/24819_2.png) [@Bifrosty](https://forum.makecode.com/u/Bifrosty)
#### Post date: [March 16, 2024, 4:38am UTC](https://forum.makecode.com/t/how-to-make-ai/27776/2 "2024-03-16T04:38:56Z")

</div>

What kind of AI, one where they randomly walk around or, like wait for the player to get close. Ect. I can totally help with this.

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [March 17, 2024, 1:39am UTC](https://forum.makecode.com/t/how-to-make-ai/27776/3 "2024-03-17T01:39:38Z")

</div>

I made a handy [AI Extension](https://forum.makecode.com/t/the-ai-extension-is-here/23603) for that!  
I can also answer any questions if you have any : )

---

<div class="post-metadata">

### Author: ![GraysonB0](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@GraysonB0](https://forum.makecode.com/u/GraysonB0)
#### Post date: [March 17, 2024, 9:59pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/4 "2024-03-17T21:59:03Z")

</div>

I have 2 ideas for what I want. One AI which does in fact walk around but also shoots enemies and says quips. Another would be one similar to Akinator. My school blocked to use of searching anything up using “AI” so I have no idea how to do it and my Computer Science teacher wont teach me how.

---

<div class="post-metadata">

### Author: ![GraysonB0](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@GraysonB0](https://forum.makecode.com/u/GraysonB0)
#### Post date: [March 17, 2024, 10:05pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/5 "2024-03-17T22:05:25Z")

</div>

How do I use the extension? I’ve tried to use it but I don’t know how to navigate it.

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [March 17, 2024, 10:39pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/6 "2024-03-17T22:39:58Z")

</div>

Ah, sorry! You’re looking for enemy AI. That extension is neural network AI, whoops!

---

<div class="post-metadata">

### Author: ![Bifrosty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bifrosty/32/24819_2.png) [@Bifrosty](https://forum.makecode.com/u/Bifrosty)
#### Post date: [March 18, 2024, 6:32pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/7 "2024-03-18T18:32:49Z")

</div>

I have no Idea how you would be able to make Akiniator, (It would probably be very complex.) However I can totally make the projectile-shooting enemy. I made a little demo.

> **[AI test](https://arcade.makecode.com/S09716-15656-00963-86609)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The AI walks around randomly (The skeletons) using a path finding algorithm. When the AI finds the player it will shoot asteroids at them. Sometimes they will even say little quips. Click edit code to open the code up to see my comments and how it’s coded. Don’t worry about the “Namespace user config” at the beginning, it makes the screen bigger for the example.  
Her are the extensions involved.

[https://github.com/felixtsu/pxt-sight](https://github.com/felixtsu/pxt-sight) - lets the enemy see you.

[https://github.com/jwunderl/arcade-tilemap-a-star](https://github.com/jwunderl/arcade-tilemap-a-star) - Path finding

[https://github.com/jwunderl/arcade-sprite-util](https://github.com/jwunderl/arcade-sprite-util) - utility

Let me know if this is not what you wanted.

---

<div class="post-metadata">

### Author: ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)
#### Post date: [March 18, 2024, 6:34pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/8 "2024-03-18T18:34:12Z")

</div>

You could do this

---

<div class="post-metadata">

### Author: ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)
#### Post date: [March 18, 2024, 6:34pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/9 "2024-03-18T18:34:16Z")

</div>

![Screenshot 2024-03-18 at 5.23.43 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/95daed39e43f08806aaf9a695b821bdd2b17cf10.png)

---

<div class="post-metadata">

### Author: ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)
#### Post date: [January 29, 2026, 5:12pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/10 "2026-01-29T17:12:27Z")

</div>

well is possible to make a AI but instead of moving it would text almost like replying to the text its given

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [January 30, 2026, 12:25am UTC](https://forum.makecode.com/t/how-to-make-ai/27776/11 "2026-01-30T00:25:44Z")

</div>

Generative AI, like ChatGPT, is not possible in Makecode as it requires massive amounts of data and servers to train, and even running it locally requires more resources than Makecode has. The closest you can get to real “AI”, aka neural networks, is something like @randomuser’s extension (mentioned above) or my [Cars with brains](https://forum.makecode.com/t/cars-with-brains-messing-around-with-small-neural-networks/39126) project, but generating text is something you cannot do in Makecode.

---

<div class="post-metadata">

### Author: ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)
#### Post date: [January 30, 2026, 7:44pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/12 "2026-01-30T19:44:49Z")

</div>

well what about a small ai that is given a words like a pumpkin is blank and it goes thro all the words to at one point get it but that also might not work so would it work to connect your game to a like AI like I don’t use python but cant you do like import OpenAI or something

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [January 31, 2026, 5:39pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/13 "2026-01-31T17:39:33Z")

</div>

The limit is the number of words you can physically store. When @AlexK made his [What’s My Word?](https://forum.makecode.com/t/introducing-whats-my-word/11998) Wordle clone, he included over 2000 words, and that’s only the 5 letter words! You would run out of space eventually.

No you can’t “import OpenAI”. You have to pay to use all those APIs, so if you’re willing to pay up then be my guest. And they are pay-per-use, so every time someone played your game it would cost you money.

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [January 31, 2026, 5:43pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/14 "2026-01-31T17:43:11Z")

</div>

To answer the first senario, if I understand correctly, that wouldn’t work; Not because the theory is wrong, but just because MakeCode can’t store a neural network that large and complex, or compute it in an reasonable amount of time.

The same is true for the second, as importing an AI database is theoretically possible, but again too large and resource-intensive for MakeCode 🙁

Although, there were definitely early adventure games that had the game reply to (or do some action because of) the user’s text, using very little processing power or storage! Each game really had a different method, but there’s a great thread on reddit [here](https://www.reddit.com/r/retrocomputing/comments/houbci/how_did_text_games_process_inputs/) to get you started on some different methods.

From there, I think this may be what you’re looking to create:  
A simple [noun-verb parser](https://en.wikipedia.org/wiki/Adventure_game#Text_adventure) would be the easiest option. [This example](https://helderman.github.io/htpataic/htpataic13.html) is written in C but definitely shows the theory behind the parser well. In MakeCode, you’d likely create a program to decide which verb and which noun a player was trying to use, then run it through an ‘if’ statement to decide what the program should do with that information.  
For example: If the player told a character to ‘run west’ it would understand ‘run’ means to set velocity very high and ‘west’ means that velocity should be towards the left.

Let me know if this is what you were looking for! The idea of a verb-noun parser in MakeCode is very interesting to me. 👀

---

<div class="post-metadata">

### Author: ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)
#### Post date: [January 31, 2026, 8:13pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/15 "2026-01-31T20:13:59Z")

</div>

well i had a texting game that i wanted to have a ai to reply to

---

<div class="post-metadata">

### Author: ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)
#### Post date: [January 31, 2026, 8:15pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/16 "2026-01-31T20:15:39Z")

</div>

so technically if I pay I can do this also with GitHub and coding stuff could there be something like it thats free that someone made

---

<div class="post-metadata">

### Author: ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)
#### Post date: [January 31, 2026, 8:16pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/17 "2026-01-31T20:16:15Z")

</div>

also could it be possible to put all the like pain/lag into something that could do it also what about vs code I don’t really use it or know what I’d use for but

---

<div class="post-metadata">

### Author: ![MeatballDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meatballdev/32/28502_2.png) [@MeatballDev](https://forum.makecode.com/u/MeatballDev)
#### Post date: [February 2, 2026, 6:09pm UTC](https://forum.makecode.com/t/how-to-make-ai/27776/18 "2026-02-02T18:09:21Z")

</div>

you could make a logic ai but it would be really tedious and not really ai and would also required to be updated but it would emulate an ai
