Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Random moves

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 11th Jul 2008 22:03
Okay as you well know about my game, Staircase! (if not it is in the WIP) I am working on a boss battle for level one. Now I need to know or need a basic idea on what I need to do to make the boss (Chuck Norris) randomly punch the main character or guard himself from the main character. How may I possibly do this?


Thanks,
~Zeus~

When Chuck Norris goes to a gas station, he doesn't pay them $4.09 a gallon, they pay him $4.09 a gallon.
Irojo
17
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 11th Jul 2008 22:28
If I understand your question right:

Is that what you were asking for?


I urge you to watch the film "Who killed the electric car". Support electric cars! Did you know their used to be more electric cars then gassoline cars?
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 11th Jul 2008 22:31
I mean out of nowhere your character doesn't have to do anything and the boss just throws a punch or guards of random. Are we on the same page Irojo?

When Chuck Norris goes to a gas station, he doesn't pay them $4.09 a gallon, they pay him $4.09 a gallon.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Jul 2008 22:46
That would work, but you would probably either need a new loop to use when fighting, or have a flag set when it is time to fight.

I have had problems using rnd() with only 2 possible numbers myself. It always seems to not quite be random. So, what I do, is choose a number (100 usuaif lly but you could do 60 if you want a number that can be divided by more different numbers). Then I can check the number to see if it is below 50 or whatever number you choose. Be sure to use randomize at the beginning too.

This will work for simple random moves, but you will probably want the behavior to change as norris gets more and more hurt. An adaptation would be this:



While this doesn't change how it works, it will change the odds of getting the results based off of what norris's current health is. You will definitely want to fine tune the equation to reflect how you do your health (if you just do one point for each time he can be hit that is different then if you want a lot of health and the hero's attack power is subtracted from that).

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 12th Jul 2008 02:16
My gosh, anyway to slow him down without affecting his health?

When Chuck Norris goes to a gas station, he doesn't pay them $4.09 a gallon, they pay him $4.09 a gallon.
Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 13th Jul 2008 05:38
my,my irojo! you have gotten better.

thats good.

anyway,
i'm guessing to slow him down, you are gonna want a timer.

AM I UGLY OR WHAT??!!
What? It's My Sig!!...
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Jul 2008 07:50
to slow him down, without getting in the way of character movement and such, you can do this:

in the loop, when he first starts doing something(like blocking) set a timer variable to 0. Then each time through, increase thehen, when it hits 20 or whatever, just guess and check, you have it choose a new move.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?

Login to post a reply

Server time is: 2025-06-07 06:42:49
Your offset time is: 2025-06-07 06:42:49