Is it possible to make semi-random AI?

help

#1

I made a boss fight in Hopscotch ("Bear Boss Battle (with sounds) V.2" if you want to look it up), but the current random movement is weird and runs into the top of the screen all of the time, even though the movement should be completely random. I tried making it move downwards when it touches the top of the screen, but it didn't work as well as I thought... Any help?


#2

A lot of check ifs or elses and variables would help.


#3

Like how? If you want to see how the AI is right now, you can search the game (as it's made by Dombro1, which is me). All I need help with is the movement AI, the attack AI is fine, like maybe you could edit how you think it should look, show me a screenshot of your edit (without remixing), then I can make changes that way.


#4

Some ideas for movement for the boss

When players x position is less than boss x position
Wait random 0-2 seconds
Change x by -5

When players x position is greater than boss x position
Wait random 0-2 seconds
Change x by 5

When boss y position is greater than players y position
Wait random 0-2
Set speed random 50-150???
Change y by -5

When boss y position is less than players y position
Wait random 0-2 seconds
Change y by 5

It would help if you delete all the "When movement equals code"


#5

The movement al is good for me... Also AWESOME GAME!


#6

i suggest adding borders using check once ifs.
https://c.gethopscotch.com/p/xxph8j8uo


#7

I figured out my error! I accidentally made bear move up more than the other movement options! I'll release Bear Boss Battle (with sounds) V.3 soon, with other edits too :smiley:

Here's a list of the edits:

  1. Fixed Bear's Movement
  2. Made bear's attacks more powerful due to how high Dino's health is
  3. Slightly edited powerups

Hope you enjoy the new version!