Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Random Animation #129588
05/12/07 23:22
05/12/07 23:22
Joined: Jul 2006
Posts: 28
B
burning_devil Offline OP
Newbie
burning_devil  Offline OP
Newbie
B

Joined: Jul 2006
Posts: 28
Hi, I am making a fighting game, and for some reason I can get everything correct besides basic AI like random attacks. I have a character that has 4 different animation attacks(punch,kick,high punch,and low kick)Can anyone please help me understand how to use random attacks like kick or punch in a random event.

Re: Random Animation [Re: burning_devil] #129589
05/12/07 23:26
05/12/07 23:26
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Use random

define attack_punch,0;
define attack_kick,1;
define attack_highpunch,2;
define attack_lowkick,3;

var ran = int(random(4));

if(ran == attack_punch) {punch();}
if(ran == attack_kick) {kick();}
if(ran == attack_highpunch) {highpunch();}
if(ran == attack_lowkick) {lowkick();}


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1