Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I create an Ai in an RPG
- EeveeMaster20
-
2 posts
How do I create an Ai in an RPG
I am just learning to code and having been taking classes, so I am sorry if the code is a bit clumsy, but I need help to determine when the enemy's turn is.
I have established a system where the player can attack on their turn when they click attack (with random damage and animations), but I cannot figure out how to make it even and odd.
I want to make it so that on even turns the player moves and on odd turns the enemy moves. However, any forums I could find would have blocks not on the online version. I really need help sorting…
If anyone has an alternate solution, that would be totally cool too!
Also, the game is no where finished, but I have to share it so that other people can view it.
https://scratch.mit.edu/projects/748864189
I have established a system where the player can attack on their turn when they click attack (with random damage and animations), but I cannot figure out how to make it even and odd.
I want to make it so that on even turns the player moves and on odd turns the enemy moves. However, any forums I could find would have blocks not on the online version. I really need help sorting…
If anyone has an alternate solution, that would be totally cool too!
Also, the game is no where finished, but I have to share it so that other people can view it.
https://scratch.mit.edu/projects/748864189
- legendary34678
-
1000+ posts
How do I create an Ai in an RPG
You can check if something is even or odd with the modulo (or mod for short) block like so:
Basically, the mod block takes the first number divided by the second number and returns the remainder, so it's super useful for things that repeat such as turn order.
Basically, the mod block takes the first number divided by the second number and returns the remainder, so it's super useful for things that repeat such as turn order.
- ROBLOXMYGUY
-
16 posts
How do I create an Ai in an RPG
I need help trying to make an ai for my rpg. there nothing i can figure out.
if theres anything, pls let me know.
if theres anything, pls let me know.
- Discussion Forums
- » Help with Scripts
-
» How do I create an Ai in an RPG